XmlMappedRange.PrintOutEx Method

Definition

Prints out the XmlMappedRange.

public object PrintOutEx (object From, object To, object Copies, object Preview, object ActivePrinter, object PrintToFile, object Collate, object PrToFileName);
abstract member PrintOutEx : obj * obj * obj * obj * obj * obj * obj * obj -> obj
Public Function PrintOutEx (Optional From As Object, Optional To As Object, Optional Copies As Object, Optional Preview As Object, Optional ActivePrinter As Object, Optional PrintToFile As Object, Optional Collate As Object, Optional PrToFileName As Object) As Object

Parameters

From
Object

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

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

If PrintToFile is set to true, this argument specifies the name of the file you want to print to.

Returns

Examples

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

Note

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,
        
        false,
        true);
}
Private Sub PrintXMLMappedRange()
    Globals.Sheet1.EmployeeNameCell.Value2 = "Karina Leal"

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

Applies to