PrintOpen

[method icon] PrintOpen(sDocumentName$, iDefaultPrinter)

Opens the printer

sDocumentName$ String The name of the document
iDefaultPrinter Integer TRUE if the Windows default printer is to be used

Applies to: Rich Edit


>PrintOpen

PrintOpen

The PrintOpen() method is called prior to the Print() method to open a connection to a printer to print the document in the Rich Text control. If the second parameter is TRUE then the default Windows printer is used otherwise the standard Printer Setup dialog is displayed allowing the user to manually select a printer.

Upon completion, i.e. when the user has selected a printer or if the connection fails, the PrintStatus() event handler is called. This gives the program an opportunity to display an appropriate error, or if successful the Print() method can be called to physically print the information.

Note that nothing is sent to the printer until the PrintClose() method is executed. This allows several documents to be printed together, for example as part of a mail merge.

Example:

.rtfControl1.PrintOpen("Mail Merge", FALSE)

See also

Rich Edit methods, properties and events.