Worksheet.PrintPreview Method (2007 System)

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

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

Syntax

'Declaration
Public Sub PrintPreview ( _
    EnableChanges As Object _
)
'Usage
Dim instance As Worksheet 
Dim EnableChanges As Object

instance.PrintPreview(EnableChanges)
public void PrintPreview(
    Object EnableChanges
)
public:
void PrintPreview(
    Object^ EnableChanges
)
public function PrintPreview(
    EnableChanges : Object
)

Parameters

Remarks

Optional Parameters

For information on optional parameters, see The Variable missing and 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

Worksheet Class

Worksheet Members

Microsoft.Office.Tools.Excel Namespace