We recommend using Visual Studio 2017

How to: Programmatically Display Documents in Print Preview

 

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

Applies to: The information in this topic applies to document-level projects and VSTO add-in projects for Word. For more information, see Features Available by Office Application and Project Type.

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

  1. Call the PrintPreview method of the Microsoft.Office.Tools.Word.Document class. To use this code example, run it from the ThisDocument class in your project.

            Me.PrintPreview()
    

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

  1. Set the P:Microsoft.Office.Interop.Word._Application.PrintPreview property of the Application object to true.

            Application.PrintPreview = True
    

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

  1. Call the M:Microsoft.Office.Interop.Word._Document.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.

            Me.Application.ActiveDocument.PrintPreview()
    

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

  1. Set the P:Microsoft.Office.Interop.Word._Application.PrintPreview property of the Application object to true.

            Application.PrintPreview = True
    

How to: Programmatically Print Documents
How to: Programmatically Open Existing Documents
How to: Programmatically Create New Documents

Show: