ChartSheetBase.PrintOutEx Method (Object, Object, Object, Object, Object, Object, Object, Object)

 

Prints the chart that is displayed on the ChartSheetBase.

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

public 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.

collate
Type: System.Object

true to collate multiple copies.

prToFileName
Type: System.Object

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

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

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

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);
}
Return to top
Show: