NamedRange::PrintOutEx Method (Object^, Object^, Object^, Object^, Object^, Object^, Object^, Object^)
Prints the object.
Assembly: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
Object^ PrintOutEx( Object^ From, Object^ To, Object^ Copies, Object^ Preview, Object^ ActivePrinter, Object^ PrintToFile, Object^ Collate, Object^ PrToFileName )
Parameters
- From
-
Type:
System::Object^
The number of the first page to start printing. By default, printing starts at the beginning.
- To
-
Type:
System::Object^
The number of the last page to print. By default, printing ends at the last page.
- Copies
-
Type:
System::Object^
The number of copies to print. By default, one copy is printed.
- Preview
-
Type:
System::Object^
true to have Excel invoke print preview before printing the object. false (or omitted) to print the object immediately.
- ActivePrinter
-
Type:
System::Object^
Sets the name of the active printer.
- PrintToFile
-
Type:
System::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:
System::Object^
true to collate multiple copies.
- PrToFileName
-
Type:
System::Object^
If PrintToFile is set to true, this argument specifies the name of the file you want to print to.
The following code example uses the PrintOutEx method to print one copy of the first two pages of the named range NamedRange1 to the default printer. To run this code example, your workbook must contain a worksheet named Sheet1 with a named range named NamedRange1 that covers a range of cells that contain some data.
This example is for a document-level customization.