Export (0) Print
Expand All
Expand Minimize

XmlMappedRange.PrintOutEx Method (2007 System)

Prints out the XmlMappedRange.

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

public Object 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 first page.

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

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 to pages in the range.

The following code example sets the value of the EmployeeNameCell XmlMappedRange control on Sheet1. Next, the example prints one copy of the first two pages of the contents of EmployeeNameCell to the default printer.

NoteNote:

Typically, you populate the XmlMappedRange control from an XML file. This example hard-codes the value of the control for simplicity.

private void PrintXMLMappedRange()
{
    Globals.Sheet1.EmployeeNameCell.Value2 = "Karina Leal";

    Globals.Sheet1.EmployeeNameCell.PrintOutEx(
        1,
        2,
        1,
        false,
        missing,
        false,
        true,
        missing);
}

Community Additions

ADD
Show:
© 2014 Microsoft