Udostępnij za pośrednictwem


WorksheetBase.PrintPreview Method

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

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

Syntax

'Declaration
Public Sub PrintPreview ( _
    enableChanges As Object _
)
public void PrintPreview(
    Object enableChanges
)

Parameters

Remarks

Optional Parameters

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

Examples

The following code example uses the PrintPreview method to display a print preview of the current worksheet.

This example is for a document-level customization.

Private Sub PreviewWorksheet()
    ' Make sure the worksheet has some data before displaying 
    ' a print preview.
    Me.Range("A1").Value2 = "123"
    Me.PrintPreview(False)
End Sub
private void PreviewWorksheet()
{
    // Make sure the worksheet has some data before displaying 
    // a print preview.
    this.Range["A1", missing].Value2 = "123";
    this.PrintPreview(false);
}

.NET Framework Security

See Also

Reference

WorksheetBase Class

Microsoft.Office.Tools.Excel Namespace