Workbook.PrintPreview Method

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

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

public virtual void PrintPreview (
	[OptionalAttribute] Object EnableChanges



true to allow changes to the margins and page setup while displaying the print preview; otherwise, false.

Optional Parameters

For information on optional parameters, see Understanding Optional Parameters in COM Interop.

The following code example uses the PrintPreview method to show a print preview of the current workbook.

private void WorkbookPrintPreview()
    // Add a range value to make sure that the workbook generates 
    // a print preview. An empty workbook will not be printed.
    Globals.Sheet1.Range["A1", "A5"].Value2 = 55;