XmlMappedRange.PrintOut Method (2007 System)

Prints the XmlMappedRange control.

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

public Object PrintOut(
	Object From,
	Object To,
	Object Copies,
	Object Preview,
	Object ActivePrinter,
	Object PrintToFile,
	Object Collate,
	Object PrToFileName


Type: System.Object

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

Type: System.Object

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

Type: System.Object

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

Type: System.Object

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

Type: System.Object

Sets the name of the active printer.

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.

Type: System.Object

true to collate multiple copies.

Type: System.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

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

Optional Parameters

For information on optional parameters, see The Variable missing and Optional Parameters in Office Solutions.

The following code example uses the PrintOut method to print an XmlMappedRange to a file. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerLastNameCell.

private void PrintToFile()
    this.CustomerLastNameCell.Value2 = "Smith";
    this.CustomerLastNameCell.PrintOut(missing, missing, 1, true, missing,
        true, missing, missing);

Community Additions