Print a Document

To print a document

  1. Open the document. See Open for more information.

    Set the OPENWaitOnOpen property to TRUE to make sure that the entire document is opened before the document is printed.

    To print a document without viewing it, set the OPENMode property to 2 (open without generating a view). You can also set the Visible property of the Viewing control object to FALSE.

  2. Use the CanPrint property to determine whether the document is completely processed and ready for printing.

  3. Optionally, use the PrintHeaders property to specify whether the file name and page number header are printed at the top of each page of the printed output.

    Used in conjunction with the PrintHeaders property, the SetPrintName method replaces the default file name field of the print header with another string.

  4. Use either the PrintDlg method to print using a common Print dialog box, or the PrintOut method to print to a specific printer without a Print dialog box.

    NOTE: Note: When printing in an application that is an NT service, a default printer must be installed for the user account using the application.