Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   OS X - Apps and Games (http://www.mac-forums.com/forums/os-x-apps-games/)
-   -   Script for Zoom in MS Office Word 2008 or 2011 (http://www.mac-forums.com/forums/os-x-apps-games/255694-script-zoom-ms-office-word-2008-2011-a.html)

Lbatson21 10-31-2011 06:24 PM

Script for Zoom in MS Office Word 2008 or 2011
 
Ok, I'm sure this might be old news to some but I'm really excited about it. I spent the last half hour or so searching for a way to automatically set the default zoom for any document I open (new or already created) in Word. Most of the responses that I found were that you can't (or at least that was all I could find, someone correct me if I'm wrong). What I was able to find was a an apple script that does exactly that. I'll explain the steps here and see if I can upload my script file and help anyone else out who might want to use this. So the link to this site Word:mac ? Window Size, View, and Zoom has several scripts for Word that might be helpful as well. The one at the bottom I had to modify and is the one I used and works for multiple open pages at once (I have it set to default all pages to 125% but this can be easily changed).

Code:

tell application "Microsoft Word"
        repeat with loopVar from 1 to count of windows
                set view type of view of (window loopVar) to page view
                set percentage of zoom of view of (window loopVar) to 125
        end repeat
end tell

The orange 125 can be changed to any size you want and this script resizes all open word documents. The red page view can be changed to any view you would like to set them to. There is a script on the link I posted above for doing so manually to each page but you're better off just selecting the percentage individually at that point.

Also, I went ahead and placed the script in the Microsoft Preferences> Word Script Menu Items folder. If you place the script there you can use the script from the drop down script icon in Word.

The final step was that I set up a shortcut key (CMD 1 for me but you can set it to anything you want) to allow me to quickly resize all my documents with the script in Word I've created. The information on how to set keyboard shortcuts is really good at this page Add Keyboard Shortcuts

I would have uploaded the script but it says invalid file. Probably a good idea not to let people upload unknown scripts. Anyway all you will need to do is open Apple script and copy and paste that code then save.

Hope this helps ;)

Lbatson21 10-31-2011 10:39 PM

I was creating another script for different zoom sizes and did find this will only work if you save the file as a script and check the box Run only. You can't edit the script once you do this but it is the only way Word will let it show up in the available scripts.


All times are GMT -4. The time now is 08:43 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.