Object Model Reference : Classes : P : PrintSettings : Methods : PrintSettings.ShowDialog |
Function ShowDialog() As Boolean
Member of PrintSettings
The ShowDialog method displays the Print dialog box.
The following VBA example displays the Print dialog box for the first file in the specified folder and then prints the CorelDRAW (CDR) files contained in that folder.
Sub Test() |
Dim ldDocument As Document |
Dim lcFolder As String |
Dim lcFileName As String |
Dim lcFullName As String |
Dim Prn As CorelDRAW.Printer |
Dim nCopies As Long |
Dim bFirst As Boolean |
lcFolder = "k:\cdrs\" |
lcFileName$ = Dir(lcFolder & "*.cdr") |
bFirst = True |
While lcFileName$ <> "" |
lcFullName = lcFolder & lcFileName |
Set ldDocument = laCorel.OpenDocument(lcFullName) |
With ldDocument.PrintSettings |
If bFirst Then |
If Not .ShowDialog Then Exit Sub |
Set Prn = .Printer |
nCopies = .Copies |
bFirst = False |
Else |
Set .Printer = Prn |
.Copies = nCopies |
End If |
End With |
ldDocument.PrintOut |
ldDocument.Close |
lcFileName$ = Dir() |
Wend |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.