Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Word Solutions
 How to: Display Documents in Print ...

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0)
How to: Display Documents in Print Preview

Applies to

The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.

Project type

  • Document-level projects

  • Application-level projects

Microsoft Office version

  • Word 2003

  • Word 2007

For more information, see Features Available by Application and Project Type.

If your solution generates a report, you might want to display the report to the user in Print Preview mode.

To display a document in Print Preview by calling the PrintPreview method

To display a document in Print Preview by setting the PrintPreview property

  • Set the PrintPreview property of the Application object to true.

    Visual Basic
    Application.PrintPreview = True
    
    
    C#
    Application.PrintPreview = true; 
    
    

To display a document in Print Preview by calling the PrintPreview method

  • Call the PrintPreview method of the Microsoft.Office.Interop.Word..::.Document that you want to preview. To use this code example, run it from the ThisAddIn class in your project.

    Visual Basic
    Me.Application.ActiveDocument.PrintPreview()
    
    
    C#
    this.Application.ActiveDocument.PrintPreview();
    
    

To display a document in Print Preview by setting the PrintPreview property

  • Set the PrintPreview property of the Application object to true.

    Visual Basic
    Application.PrintPreview = True
    
    
    C#
    Application.PrintPreview = true; 
    
    
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker