Worksheet.PrintOut Method
Prints the worksheet.
Assemblies: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)
void PrintOut(
Object From,
Object To,
Object Copies,
Object Preview,
Object ActivePrinter,
Object PrintToFile,
Object Collate,
Object PrToFileName
)
Parameters
- From
- Type: Object
The number of the page at which to start printing. If this argument is omitted, printing starts at the beginning.
- To
- Type: Object
The number of the last page to print. If this argument is omitted, printing ends with the last page.
- Copies
- Type: Object
The number of copies to print. If this argument is omitted, one copy is printed.
- Preview
- Type: Object
true to have Microsoft Office Excel invoke print preview before printing the object; false (or omitted) to print the object immediately.
- ActivePrinter
- Type: Object
Sets the name of the active printer.
- PrintToFile
- Type: Object
true to print to a file. If PrToFileName is not specified, Excel prompts the user to enter the name of the output file.
- Collate
- Type: Object
true to collate multiple copies.
- PrToFileName
- Type: Object
If PrintToFile is set to true, this argument specifies the name of the file you want to print to.
"Pages" in the descriptions of From and To refers to printed pages, not to overall pages in the worksheet.
Optional Parameters
For information on optional parameters, see Optional Parameters in Office Solutions.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.