Share via


Chart.PrintOutEx Method

Prints the chart.

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

Syntax

'Declaration
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 _
)
void 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 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 (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.
  • PrToFileName
    Type: System.Object
    The name of the file to print to. This parameter is used only if PrintToFile is true.

Remarks

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

Optional Parameters

For information about optional parameters, see Optional Parameters in Office Solutions.

Examples

The following code example uses the PrintOutEx method to print one copy of the first two pages of the chart Chart_1 to the default printer. To run this code example, your workbook must contain a worksheet named Sheet1 with a chart named Chart_1.

Private Sub PrintChart()
    Dim myChart As Microsoft.Office.Tools.Excel.Chart = _
        Globals.Sheet1.Chart_1

    myChart.PrintOutEx( _
        From:=1, _
        To:=2, _
        Copies:=1, _
        Preview:=False)
End Sub
private void PrintChart()
{
    Microsoft.Office.Tools.Excel.Chart myChart =
        Globals.Sheet1.Chart_1;

    myChart.PrintOutEx(
        1,
        2,
        1,
        false,
        missing,
        false,
        true,
        missing);
}

.NET Framework Security

See Also

Reference

Chart Interface

Microsoft.Office.Tools.Excel Namespace