Word

Open Document In Print Preview

Ease of Use

Easy

Version tested with

2000, 2002 

Submitted by:

MOS MASTER

Description:

The document is opened in Print Preview 

Discussion:

A easy way to open documents directly in to Print Preview so you can take a last peak before you print it. (Like reports you need to print) 

Code:

instructions for use

			

Option Explicit 'Eventhandler which fires when document is opened. Private Sub Document_Open() ' \\ got to printpreview ActiveDocument.Print Preview ' \\ set zoom percentage of window to 100 ActiveWindow.ActivePane.View.Zoom.Percentage = 100 End Sub

How to use:

  1. Open your Word document.
  2. Press Alt + F11 to open the VBE window.
  3. Double click "ThisDocument" on the project explorer. (press CTRL+R to view)
  4. Paste the code there in the window at right. (F7)
  5. Close VBE (Alt + Q or press the X in the top right hand corner).
  6. Save the file.
 

Test the code:

  1. Open the document by double clicking on it
  2. Choose yes to enable Macro's
  3. The document is opened in Print Preview
 

Sample File:

Open in printpreview.zip 12.67KB 

Approved by mdmackillop


This entry has been viewed 83 times.

Please read our Legal Information and Privacy Policy
Copyright @2004 - 2020 VBA Express