Workbook.PrintOutEx Method (2007 System)

Prints the workbook.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
Public Sub PrintOutEx ( _
    From As Object, _
    To As Object, _
    Copies As Object, _
    Preview As Object, _
    ActivePrinter As Object, _
    PrintToFile As Object, _
    Collate As Object, _
    PrToFileName As Object, _
    IgnorePrintAreas As Object _
)
'Usage
Dim instance As Workbook 
Dim From As Object 
Dim To As Object 
Dim Copies As Object 
Dim Preview As Object 
Dim ActivePrinter As Object 
Dim PrintToFile As Object 
Dim Collate As Object 
Dim PrToFileName As Object 
Dim IgnorePrintAreas As Object

instance.PrintOutEx(From, To, Copies, Preview, _
    ActivePrinter, PrintToFile, Collate, _
    PrToFileName, IgnorePrintAreas)
public void PrintOutEx(
    Object From,
    Object To,
    Object Copies,
    Object Preview,
    Object ActivePrinter,
    Object PrintToFile,
    Object Collate,
    Object PrToFileName,
    Object IgnorePrintAreas
)
public:
void PrintOutEx(
    Object^ From, 
    Object^ To, 
    Object^ Copies, 
    Object^ Preview, 
    Object^ ActivePrinter, 
    Object^ PrintToFile, 
    Object^ Collate, 
    Object^ PrToFileName, 
    Object^ IgnorePrintAreas
)
public function PrintOutEx(
    From : Object, 
    To : Object, 
    Copies : Object, 
    Preview : Object, 
    ActivePrinter : Object, 
    PrintToFile : Object, 
    Collate : Object, 
    PrToFileName : Object, 
    IgnorePrintAreas : Object
)

Parameters

  • From
    Type: System.Object

    The number of the page at which to start printing. If this argument is omitted, printing starts at the beginning.

  • To
    Type: System.Object

    The number of the last page to print. If this argument is omitted, printing ends with the last page.

  • Copies
    Type: System.Object

    The number of copies to print. If this argument is omitted, one copy is printed.

  • Preview
    Type: System.Object

    true to have Microsoft Office Excel invoke print preview before printing the object. false 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.

  • PrToFileName
    Type: System.Object

    If PrintToFile is set to true, this argument specifies the name of the file you want to print to.

  • IgnorePrintAreas
    Type: System.Object

    true to ignore print areas and print the entire workbook; otherwise, false.

Remarks

"Pages" in the descriptions of From and To refers to printed pages, not to overall pages in the sheet or workbook.

Optional Parameters

For information on optional parameters, see The Variable missing and Optional Parameters in Office Solutions.

Examples

The following code example uses the PrintOutEx method to print two collated copies of the first two printed pages of the workbook to the default printer.

This example is for a document-level customization.

Private Sub PrintWorkbook()
    Me.PrintOutEx( _
        From:=1, _
        To:=2, _
        Copies:=2, _
        Preview:=False, _
        Collate:=True, _
        IgnorePrintAreas:=True)
End Sub
private void PrintWorkbook()
{
    this.PrintOutEx(
        1, 
        2, 
        2, 
        false, 
        missing,
        false,
        true, 
        missing,
        true);
}

.NET Framework Security

See Also

Reference

Workbook Class

Workbook Members

Microsoft.Office.Tools.Excel Namespace