The PrintOut method will print all or part of a document. Its syntax is:
Background, Append, Range, _
OutputFileName, From, To, Item, Copies, Pages, _
PageType, PrintToFile, Collate, FileName, _
Note that the PrintOut method can also be applied to a Window object to print the contents of the window, or it can be used globally, as in:
to print the active document. The myriad arguments of the method correspond to the items on the Print dialog box. All of these arguments are optional variants.
In addition to using the PrintOut method in this global way, we frequently want to exercise greater control over printing. The following sections examine some of the ways that you can do that.
To print to a file, set the following parameters of the PrintOut method:
Set this to True to print to a file.
Set this to the full path and name of the output file.
Set this to True to append the document to the output file or False to over-write the contents of the output file.
To restrict printing, set the following parameters:
The page range for printing. It can be any one of the constants in the following enum:
Enum WdPrintOutRange wdPrintAllDocument = 0 wdPrintSelection = 1 wdPrintCurrentPage = 2 wdPrintFromTo = 3 wdPrintRangeOfPages = 4 End Enum
wdPrintFromTo, set this to the starting page number. ...