_Worksheet.PrintOut Method

Prints the object.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Sub PrintOut ( _
    From As Object, _
    To As Object, _
    Copies As Object, _
    Preview As Object, _
    ActivePrinter As Object, _
    PrintToFile As Object, _
    Collate As Object, _
    PrToFileName As Object _
)
'Usage
Dim instance As _Worksheet
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

instance.PrintOut(From, To, Copies, Preview, _
    ActivePrinter, PrintToFile, Collate, _
    PrToFileName)
void PrintOut(
    Object From,
    Object To,
    Object Copies,
    Object Preview,
    Object ActivePrinter,
    Object PrintToFile,
    Object Collate,
    Object PrToFileName
)

Parameters

  • From
    Type: System.Object

    Optional 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

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

  • Copies
    Type: System.Object

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

  • Preview
    Type: System.Object

    Optional Object. True to have Microsoft Excel invoke print preview before printing the object. False (or omitted) to print the object immediately.

  • ActivePrinter
    Type: System.Object

    Optional Object. Sets the name of the active printer.

  • PrintToFile
    Type: System.Object

    Optional Object. True to print to a file. If PrToFileName is not specified, Microsoft Excel prompts the user to enter the name of the output file.

  • Collate
    Type: System.Object

    Optional Object. True to collate multiple copies.

  • PrToFileName
    Type: System.Object

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

Remarks

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

See Also

Reference

_Worksheet Interface

_Worksheet Members

Microsoft.Office.Interop.Excel Namespace