ChartSheet.PrintOutEx(Object, Object, Object, Object, Object, Object, Object, Object) Method

Definition

Prints the chart that is displayed on the ChartSheet.

public void PrintOutEx (object From, object To, object Copies, object Preview, object ActivePrinter, object PrintToFile, object Collate, object PrToFileName);

Parameters

From
Object

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

To
Object

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

Copies
Object

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

Preview
Object

true to have Microsoft Office Excel invoke print preview before printing the object. false (or omitted) to print the object immediately.

ActivePrinter
Object

Sets the name of the active printer.

PrintToFile
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
Object

true to collate multiple copies.

PrToFileName
Object

The name of the file to print to. This parameter is used only if PrintToFile is true.

Examples

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

private void PrintChartsheet()
{
    Microsoft.Office.Tools.Excel.ChartSheet myChartSheet =
        Globals.Chart1.Base;

    myChartSheet.PrintOutEx(
        1,
        2,
        1,
        false,
        
        false,
        true);
}
Private Sub PrintChartsheet()
    Dim myChartSheet As Microsoft.Office.Tools.Excel.ChartSheet = _
    Globals.Chart1.Base

    myChartSheet.PrintOutEx( _
        From:=1, _
        To:=2, _
        Copies:=1, _
        Preview:=False)            
End Sub

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.

Applies to