Set Window Size, View, and Zoom

applies to Word 2008

contributed by Daiya Mitchell

Word documents carry the window size and view setting with them, so that if you receive attachments from other people, or open your old documents on a new computer, you may you have to resize every document, or change the zoom on every attachment you receive, or set every document to Draft View because that's what you prefer. This gets old very fast.

This page offers directions to write a script to set the Size, View, and Zoom for a window in a single click. You can also activate certain toolbars for custom workspace arrangements.

Known Issues

Change the Size/View/Zoom in One Click

Use at your own risk; See the Script Caveat

The general principle here is that you use a script that carries out three or four actions at once. But it's a bit tricky to put the script together, because everyone has different preferences. So you'll need to look at my samples here, and use the instructions to develop your own script. (If I really knew AppleScript, I could write a little application that would get your preferences and edit the script for you, but I don't. Too bad. I didn't even write this little bit of code—Shawn Larson and Barry Wainwright contributed the basic samples here. I also apologize to real AppleScripters for the inappropriate formatting of the scripts.)

Script Editor tends to choke on text copied from the web, so it's probably easiest to download and edit this sample scripts.

Download the script and double-click to open in Script Editor.

The scripts include comments guiding you through basic editing—if you like, this page has more extensive discussion of how the scripts work.

If you have never used Script Editor before: Gray text is a comment that explains the script, while colored text is code. You will need to hit the Compile button to check your script for errors after making changes. Hit the Run button to test your script—it will run in Word and you can check the results. For more, see Mac Help on Script Editor.

Once you are sure you are happy with the script, resave it into [username]/Documents/Microsoft User Data/Word Script Menu Items. Select it from the script menu in Word to run it. You can assign keyboard shortcuts as well.

Customizing Your Script

My preferred script sets the window size, turns on draft view, and sets the zoom at 125%. You'll need to substitute your own preferred settings for anything in green.

tell application "Microsoft Word"
activate
set bounds of active window to {41, 56, 662, 854}
set view type of view of active window to draft view
set percentage of zoom of view of active window to 125
end tell

Changing the Size and Position

set bounds of active window to {41, 56, 662, 854}

41 and 56 tell Word how far from the top left corner to put the document, 662 is the width of the document, and 854 is the height. These pixel numbers are going to be different for every person and every monitor (mine are carefully calibrated to fit two documents side-by-side on a 15-inch laptop). Here's how to figure out yours.

Open a single window in Word. Set it to your preferred size and location. Now open a second script window in Script Editor, and run this script (or Download Get Window Size Script):

tell application "Microsoft Word"
get bounds of active window
end tell

In the Result pane at the bottom of the Script Editor window, you should see something like:

{41, 56, 662, 854}

Substitute that result into the script.

Changing the Zoom

set percentage of zoom of view of active window to 125

To change the Zoom percentage, just substitute a reasonable number for 125 (Word offers between 10% and 500% on the Zoom menu).

To set Zoom to Page Width, substitute this entire line:

set page fit of zoom of view of active window to page fit best fit

To set Zoom to Whole Page, substitute this entire line:

set page fit of zoom of view of active window to page fit full page

Changing the View

set view type of view of active window to draft view

Instead of draft view, in this line you can use any of the following (Print Layout is "page view"):

normal view

draft view

outline view

page view

master view

online view

Add a Toolbar—Getting Fancy with Custom Workspaces

Sometimes I use Track Changes to grade student papers. To do so, I need to set each student's paper to Page Layout View, set the window to take up my entire screen, enlarge the zoom, and bring up the reviewing toolbar and my custom grading toolbar, which is very different from my usual Word setup.

I can write a script "Set Up Grading" to do all of this in one click, using the information above.

tell application "Microsoft Word"
activate
set bounds of active window to {43, 55, 1276, 821}
set view type of view of active window to page view
set percentage of zoom of view of active window to 150

set visible of command bar "Reviewing" to true
set visible of command bar "Grading" to true
end tell

Notice that AppleScript calls toolbars "command bars". Just look in View>Toolbars to get the right name for your preferred toolbar, and be sure to enclose it in quotation marks.

Changing All Windows at Once

A more advanced version from J.E. McGimpsey sets ALL of the open windows (Word can have many different documents open at once).


tell application "Microsoft Word"
  repeat with loopVar from 1 to count of windows
    if not window state of (window loopVar) is ?
        window state minimize then
          set bounds of (window loopVar) to {41, 56, 662, 854}
          set view type of view of (window loopVar) to page view
          set percentage of zoom of view of (window loopVar) to 125
     end if
  end repeat
end tell
 

 

PS. I also use a script to change the text size of the comment balloons for each student paper. Post on the newsgroup [Lene Fredborg, 14-Jun-2020: Removed outdated link to http://www.officeformac.com/ProductForums/Word/] if you want to know about that.