Print Out Method

The PrintOut method prints a range. (This method applies to a host of other objects as well, such as Worksheet, Workbook, and Chart.) The syntax is:

RangeObject.PrintOut(From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate)

Note that all of the parameters to this method are optional.

The From parameter specifies the page number of the first page to print, and the To parameter specifies the last page to print. If omitted, the entire object (range, worksheet, etc.) is printed.

The Copies parameter specifies the number of copies to print. The default is 1.

Set Preview to True to invoke print preview rather than printing immediately. The default is

False. ActivePrinter sets the name of the active printer.

Setting PrintToFile to True causes Excel to print to a file. Excel will prompt the user for the name of the output file. (Unfortunately, there is no way to specify the name of the output file in code!)

The Collate parameter should be set to True to collate multiple multipage copies.

0 0


Post a comment