共用方式為


WorksheetBase.PrintPreview(Object) Method

Definition

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

public void PrintPreview (object enableChanges);
member this.PrintPreview : obj -> unit
Public Sub PrintPreview (Optional enableChanges As Object)

Parameters

enableChanges
Object

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 void PreviewWorksheet()
{
    // Make sure the worksheet has some data before displaying 
    // a print preview.
    this.Range["A1"].Value2 = "123";
    this.PrintPreview(false);
}
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

Remarks

Optional Parameters

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

Applies to