Expand Minimize

NamedRange.PrintPreview Method

Shows a preview of the NamedRange control as it would look when printed.

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

Object PrintPreview(
	Object EnableChanges
)

Parameters

EnableChanges
Type: System.Object
true to enable changes while print preview is displayed; otherwise, false.

Return Value

Type: System.Object

Optional Parameters

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

The following code example sets the values of the cells in a NamedRange control to random numbers, and then uses the PrintPreview method to generate a print preview of the contents of the named range.

This example is for a document-level customization.


private void ShowPrintPreview()
{
    Microsoft.Office.Tools.Excel.NamedRange namedRange1 =
        this.Controls.AddNamedRange(this.Range["A1", "E5"],
        "namedRange1");

    namedRange1.Formula = "=Rand()";
    namedRange1.PrintPreview(missing);
}


Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft