Previous Document Next Document
PrintSettings.ShowDialog

Function ShowDialog() As Boolean

Member of PrintSettings

The ShowDialog method displays the Print dialog box.

The following code example displays the Print dialog box for the first file in the specified folder, and then prints the CorelDRAW (CDR) files contained in the 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 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.