Share via


Range.PrintOut Method

Prints the object.

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

Syntax

'Declaration
Function 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 _
) As Object
'Usage
Dim instance As Range
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 returnValue As Object

returnValue = instance.PrintOut(From, _
    To, Copies, Preview, ActivePrinter, _
    PrintToFile, Collate, PrToFileName)
Object 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.

Return Value

Type: System.Object

Remarks

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

See Also

Reference

Range Interface

Range Members

Microsoft.Office.Interop.Excel Namespace