Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can word remember the window size I like?

1,547 views
Skip to first unread message

kev...@officeformac.com

unread,
Dec 4, 2009, 10:18:18 PM12/4/09
to
Version: 2004 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I just got on leopard with 27" monitor. Like seeing multiple pages on screen. But my test show that word will not reopen a document with same sizing I left off with.
And it's too much of a pain to have to drag out every single time. any ideas? thanks.

John McGhie

unread,
Dec 4, 2009, 11:55:52 PM12/4/09
to
Hi Kev:

Word is designed to open each document at the size you last saved it at.

To set this globally, close all other documents, open the Normal.dotm, set
the size you want, add and remove a space to force a save, then save
Normal.dotm and quit Word.

If it doesn't hold, you may have corrupt preferences.

Cheers

On 5/12/09 2:18 PM, in article 59bae...@webcrossing.JaKIaxP2ac0,
"kev...@officeformac.com" <kev...@officeformac.com> wrote:

--

The email below is my business email -- Please do not email me about forum
matters unless I ask you to; or unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410
+61 4 1209 1410, mailto:jo...@mcghie.name


kev...@officeformac.com

unread,
Dec 5, 2009, 2:17:36 PM12/5/09
to
John,
Here is the deal.
I have dozens of word documents on my hard drives.
I now decide I want them all to open in a certain size and look.
If there a way to tell work you want all old documents to open up a certain way?

Michel Bintener

unread,
Dec 5, 2009, 3:11:10 PM12/5/09
to
Hi kevs,

here's a suggestion I posted in a different thread on Monday.

Copy the following text into Script Editor / AppleScript Editor (use
Spotlight to find the application):

tell application "Microsoft Word"
activate
tell active window
set width to 1020
set height to 770
end tell
set view type of view of active window to page view
set percentage of zoom of view of active window to 150
end tell

You can now customise this script to your heart's content; change the width
and height of the document (in pixels), change the zoom, or even change the
view. Save the AppleScript, then put it in ~/Documents/Microsoft User
Data/Word Script Menu Items (where "~" stands for your user account). The
script is now available in Word's script menu (the tiny black scroll in the
menu bar). When you select the script, Word will automatically change the
current document to match your settings.

Optional, but insanely useful: when naming your AppleScript, add "\c"
(without the quotation marks), followed by any letter. If you open a
document in Word and hit Ctrl (that's what the "\c" is for) plus the letter
you have just added to the name, the script will be triggered via this
keyboard shortcut. That's precisely what I have done, and now, I only need
to hit Ctrl+n to make Word resize the current document.

On 05/12/09 20:17, in article 59bae...@webcrossing.JaKIaxP2ac0,
"kev...@officeformac.com" <kev...@officeformac.com> wrote:

--
Michel Bintener
Microsoft MVP - Macintosh

*** Please always reply to the newsgroup. ***

kev...@officeformac.com

unread,
Dec 5, 2009, 4:38:30 PM12/5/09
to
MIchael,
never used script editor.
After you copy it it, is there some master template somewhere I tweak?

John, it is sticking -- I reopen and close, open, and window sticks except it does not seem to keep 125% view, is that normal?

Michel Bintener

unread,
Dec 5, 2009, 5:27:07 PM12/5/09
to
I don't understand your question. This script is not attached to a template,
it simply resides in the script folder I indicated in my earlier post. You
can access this script from within Word, but it is not attached to a
specific document.


On 05/12/09 22:38, in article 59bae...@webcrossing.JaKIaxP2ac0,
"kev...@officeformac.com" <kev...@officeformac.com> wrote:

> MIchael,
> never used script editor.
> After you copy it it, is there some master template somewhere I tweak?

--

John McGhie

unread,
Dec 5, 2009, 6:29:54 PM12/5/09
to
Hi Kevs:

No, on my system they all open at 200%. You may need to blow away your Word
preferences and do it again.

Note that you need to "set" both window size and zoom level, then make a
change to the text (add and remove a space) then save, then quite Word.

No other documents can be open when you edit the Normal template, otherwise
the settings you had when you opened the other documents will remain in
memory and overwrite when you quit.

But I would not bother fiddling around with this: use Michel's AppleScript
:-) I use VBA to do this, but in Word 2008 you have to use AppleScript.

Cheers

On 6/12/09 8:38 AM, in article 59bae...@webcrossing.JaKIaxP2ac0,
"kev...@officeformac.com" <kev...@officeformac.com> wrote:

--

kev...@officeformac.com

unread,
Dec 6, 2009, 1:13:23 PM12/6/09
to
ok
this was pasted into a script in apple script editor:

tell application "Microsoft Word"
        activate
        tell active window
                set width to 1020
                set height to 770
        end tell
        set view type of view of active window to page view
        set percentage of zoom of view of active window to 150
end tell

Nothin happens though. I open new documents and they are at 100%

kev...@officeformac.com

unread,
Dec 6, 2009, 1:12:19 PM12/6/09
to
John, you mean the normal document in my MUD folder?
It does not say .dotm
I've never seen .dotm, what is that?

Also, I'm on 2004.

Never used a script so that is very complex for me.

I just pasted MIcheal script into the script editor, but did not work.
Of course, I don't really know what I'm doing.

I need help though guys, I can barely see my words at 100%

Michel Bintener

unread,
Dec 6, 2009, 3:13:42 PM12/6/09
to
kevs,

you need to read my entire post and follow *all* the instructions. If you do
not actually run the script, the window won't be resized.


On 06/12/09 19:13, in article 59bae...@webcrossing.JaKIaxP2ac0,
"kev...@officeformac.com" <kev...@officeformac.com> wrote:

--

John McGhie

unread,
Dec 6, 2009, 7:31:26 PM12/6/09
to
Hi Kevs:

Sorry, you're right. If you're on Word 2004, then you don't have a
Normal.dotm, you have a file simply called "Normal" and it does indeed
reside in your Mud folder.

And, because you have Word 2004, you can use VBA which is much simpler than
AppleScript.

The following macro will set the Word window height to 100 % and the zoom to
125%:

Option Explicit

Sub AutoExec()
Call SetWindowSize
End Sub
Sub AutoOpen()
Call SetWindowSize
End Sub
Sub AutoNew()
Call SetWindowSize
End Sub


Sub SetWindowSize()
'
' SetWindowSize Macro
'
'
Dim aDoc As Document
Dim aWindow As Window

Set aDoc = ActiveDocument
Set aWindow = aDoc.ActiveWindow

With aWindow
.WindowState = wdWindowStateNormal
.Top = 5
.Left = 5
.Height = (Application.UsableHeight * 1)
.Width = (Application.UsableWidth * 0.5)
.View.Zoom.Percentage = 125
End With

End Sub


Just

1) paste the whole thing into TextEdit, then
2) convert it to plain text, then
3) paste it into a new module in the Visual Basic Editor.

You must go to TextEdit first because in your browser the spaces will be
converted to non-breaking spaces, and due to a bug in VBA, it will refuse to
compile.

Read the following instructions carefully:

http://word.mvps.org/Mac/InstallMacro.html

This macro is coded so that it runs automatically whenever Word starts,
opens a document, or creates a document. That's something you can't do in
AppleScript: with AppleScript, you must manually "run" the AppleScript. If
you code VBA correctly, it will run automatically when it is needed.

From now, you will never have to set a window size or a zoom ratio :-)

Now: You can adjust the code to your exact tastes. All the action takes
place in the "With... End With" block.

The line beginning ".Height" is asking your computer how high your screen
is, and setting the window to that height. If you do not want Word to be
the full height of the screen, specify a number smaller than "1" after the
asterisk in that line. For example:
.Height = (Application.UsableHeight * 0.95) will make the window 95 % of
your monitor height.

Similarly, the .Width line does exactly the same thing with the width. I
set mine to "half" (which is 0.5) because I have a wide-screen monitor and I
want to be able to do other things as well as work in Word. Tweak that
number until it makes you happy.

Finally, the line .View.Zoom.Percentage = 125
Sets the size of the text as a percentage of what Word thinks your font
height is. (The font heights in Mac Word are totally nonsense: the
mechanism still assumes the screen is set to 72 dpi, which no modern screen
ever is...). On my monitor, 125% is about right: your monitor is bigger, so
you may want to go a little higher.

While you are tweaking, you need to save the macro, then re-open a document
each time, to see the effect.

Cheers

On 7/12/09 5:12 AM, in article 59bae...@webcrossing.JaKIaxP2ac0,
"kev...@officeformac.com" <kev...@officeformac.com> wrote:

--

kev...@officeformac.com

unread,
Dec 6, 2009, 11:23:12 PM12/6/09
to
John,
thanks. But as Micheal points out (I did not think of this)
even if I successfully do a script -- which is a nasty macro basically, I will have to run it each and every time on all old files. correct?
It may just be cleaner and faster to just manually resize and zoom/save for each of those older files no?

In other words. there is no global way to have all you old files just open up the way you now want them after you double click?

side related question:
On my old monitor Word would open up with a new file in center of the screen.
On new huge 27" it open to extreme left. Anything I can do about this?
I tried with normal to save it to center - to no avail. new ones still jump to the extreme left.

John McGhie

unread,
Dec 7, 2009, 1:12:12 AM12/7/09
to
Hi Kevs:

Wrong! Kev, please read the post I sent you. All of it :-)

And yes, you can adjust the macro I sent you to move the Word window
wherever you like.

Cheers


On 7/12/09 3:23 PM, in article 59bae...@webcrossing.JaKIaxP2ac0,
"kev...@officeformac.com" <kev...@officeformac.com> wrote:

--

kev...@officeformac.com

unread,
Dec 10, 2009, 1:57:14 AM12/10/09
to
John, familar with Keyboard Maestro?
I may use it to deal with Entourage, same kind of issue. Better than macros with word?

Is your macro going to resize all old files to 125%? thanks.

John McGhie

unread,
Dec 10, 2009, 4:01:09 AM12/10/09
to
I am not familiar with Keyboard Maestro: there is something in the back of
my mind about an incompatibility, but that may be with Office 2008.

Yes: my macro operates whenever Word opens ANY file. It resizes them ALL to
whatever percentage you type where I showed you in the code.

Cheers

On 10/12/09 5:57 PM, in article 59bae...@webcrossing.JaKIaxP2ac0,
"kev...@officeformac.com" <kev...@officeformac.com> wrote:

--

kev...@officeformac.com

unread,
Dec 10, 2009, 9:35:15 PM12/10/09
to
Ok John, converted to plain text and pasted into a macro.
after that do you do something to indicate the macro is ready?
I was just left hanging with macro toolbar on left side of screen.

Clicked on old file. did not work.
read the tutorial.

John McGhie

unread,
Dec 11, 2009, 7:34:25 PM12/11/09
to
Hi Kevs:

Just CLOSE the Macro Editor by clicking the blue W in the top left corner.

Then, if you like, close and re-open Word to make sure things have saved.

But there's no need to do anything else, really, provided you pasted the
whole thing.

I actually sent you FOUR macros: you need all four. The first three are
simply "Auto Run" macros. Their names are special: any time Word opens a
document it looks for a macro named AutoOpen() and runs it if it finds it.
Same AutoExec, which runs when Word starts, and AutoNew runs whenever you
create a new document within Word.

Each of those macros simply calls the fourth macro, which does the work.

You cannot change any of these names.

There are some other things you have to watch for:

* You must paste these macros into your Normal Template (and it must be the
Normal Template that Word is using, if you have more than one). If you
followed the method I suggested, it's actually rather difficult to do
anything other than get that right.

* There must not be any OTHER macros with names beginning with "Auto..." in
that Template. If there are, only the first one in the template will run.

* If the system is running slow, we sometimes need to insert a timer into
those macros to give the document time to open, otherwise the macro runs
before the document has arrived and it therefore doesn't work.

Let me know if it's not working for you and I'll help you debug it. I have
been using this since about 1997, and it's very reliable once you get it
right, and saves a hell of a lot of time.

Cheers


On 11/12/09 1:35 PM, in article 59bae...@webcrossing.JaKIaxP2ac0,
"kev...@officeformac.com" <kev...@officeformac.com> wrote:

--

kev...@officeformac.com

unread,
Dec 11, 2009, 10:21:21 PM12/11/09
to
John,
Oh man, this sounds so hairy, my God.

Not that it wont work with your help, but I'd have to take a few days off just to phychologically prepare for it..

Let me think it over!

Too bad not just a plug in or something.

John McGhie

unread,
Dec 11, 2009, 11:26:59 PM12/11/09
to
For heaven's sake, you've probably DONE it all :-)

Just close the VBA Editor and it's probably working already... :-)

Cheers


On 12/12/09 2:21 PM, in article 59bae...@webcrossing.JaKIaxP2ac0,
"kev...@officeformac.com" <kev...@officeformac.com> wrote:

--

kev...@officeformac.com

unread,
Dec 11, 2009, 11:53:32 PM12/11/09
to
John, done what? I don't even recall the first there macros you are talking about. .. maybe you can unify it. But again, I pasted that one thing in did not work, so deleted it.
John,
also, in normal document, I got it to stick at 125%, but it will not center, even though I save it centered. It still launches upper left screen upon launch of app.

John McGhie

unread,
Dec 12, 2009, 8:10:52 AM12/12/09
to
Kevs, Kevs, Kevs...

You actually have to read this stuff you know :-) You have two threads
going in two different newsgroups. I sent you the whole thing, then I sent
you a replacement for one of the four macros.

Here it is again: This time, delete everything you have in your Normal
Template, and then paste this in, in its place:

Option Explicit

Sub AutoOpen()
Call SetWindowSize
End Sub
Sub AutoNew()
Call SetWindowSize
End Sub

Sub SetWindowSize()
'
' SetWindowSize Macro
'
'
Dim aDoc As Document
Dim aWindow As Window

Set aDoc = ActiveDocument
Set aWindow = aDoc.ActiveWindow

With aWindow
.WindowState = wdWindowStateNormal

.Height = (Application.UsableHeight * 1)
.Width = (Application.UsableWidth * 0.5)

.Left = ((Application.UsableWidth - .Width) / 2)


.View.Zoom.Percentage = 125
End With

End Sub

Remember you have to paste into TextEdit first, and "Make Plain Text". Then
copy from TextEdit and paste into the VBA Editor.

Note: I have condensed this: there are now THREE macros, not four. Each
line beginning with "Sub" marks the beginning of a macro (a "subroutine").
Each line that contains only "End Sub" marks the end of a macro.

When you paste this in, if any parts turn red, tell me what they are: that's
a compile error and it won't run if that happens.

Cheers

On 12/12/09 3:53 PM, in article 59bae...@webcrossing.JaKIaxP2ac0,
"kev...@officeformac.com" <kev...@officeformac.com> wrote:

--

kev...@officeformac.com

unread,
Dec 12, 2009, 11:16:43 AM12/12/09
to
JOHN,
I pasted it text to macro, then what?
I don't even know how to exit that.
there is no record button to stop.
Everything just hangs there, how do I know that macro is done?

kev...@officeformac.com

unread,
Dec 12, 2009, 11:23:51 AM12/12/09
to
Ok- I got it deleted using organzier, but had to delete my only two macros I had. This why I hate macro, if you don't know what your are doing it's very dangerous stuff. I have no idea what I'm doing.
I'm painting by numbers.

kev...@officeformac.com

unread,
Dec 12, 2009, 11:24:34 AM12/12/09
to
"delete everything in normal template -- paste this is?"

You mean open up normal and paste macro text in there as well?

kev...@officeformac.com

unread,
Dec 12, 2009, 11:20:44 AM12/12/09
to
I deleted all sub macros but the title one I made reszie I can't delete now. greyed out, delete button, why

http://tinypic.com/r/2ajnhiv/6

John McGhie

unread,
Dec 12, 2009, 6:57:14 PM12/12/09
to
When you are done: close the VBA editor by clicking the blue W icon at the
top left of the VBA Editor window.


On 13/12/09 3:16 AM, in article 59bae...@webcrossing.JaKIaxP2ac0,
"kev...@officeformac.com" <kev...@officeformac.com> wrote:

--

John McGhie

unread,
Dec 12, 2009, 7:37:52 PM12/12/09
to
You CHANGED THE NAME :-)

This is a structure of macros that call each other by name. If you change
the name of the macro, it cannot work.

There are three macros I sent in the bundle. They need to be pasted as a
single piece of text.

You must not change any of the names.

The names are hard-coded in the top line of each macro.

Try this:

1) Hit Option + F11 to open the VBA Editor. When it opens, you should see
a three-pane view. The top left pane should be named "Projects". That
lists all of the templates and documents that are open.

2) The Normal project (which is the Normal Template) should be expanded. If
it isn't, click the grey disclosure triangle to the left of the name to drop
it down.

There will be a project below named "Project (Document 1)". That's the open
document: stay out of there. We never put macros in there.

3) Chances are in your template you have only one module, and it is
probably named "NewMacros". I can't tell: you could have changed this, but
you probably haven't. If you cannot see any modules listed, drop down the
disclosure triangle on "Modules" so you can.

4) If it is called NewMacros, double-click it to open it. A pane will
appear to the right headed "Normal � NewMacros (Code)."

See the screen shot here:
http://public.jgmcghie.fastmail.com.au/VBA%20Editor

Now, you can see the three macros in the screen shot? They are named "Sub
AutoOpen()", "Sub AutoNew()" and "Sub SetWindowSize".

Paste the text I sent so that it looks exactly like the screen shot.

Make sure you have no other macros named "AutoOpen", "AutoNew", or
"SetWindowSize". (If you have, you will get a warning about "Multiple names
in the same context" when you try to compile.)

If any lines turn RED, there is a problem with your pasting. You may have
forgotten to "Make Plain Text". Tell me which ones they are, if that is the
case, and I will help you fix them.

Let's check if everything is OK: On the Debug menu, choose the "Compile
Normal" entry. If all is going well, it should appear as if nothing
happened. If there are any errors anywhere in your Normal Template VBA, the
first error found will be highlighted in yellow, and a message will appear
telling you what is wrong.

Assuming no errors, close the VBA Editor by clicking the blue W you see at
the top left of the screenshot.

That's all you have to do: it's working now :-)

It would be good if you were to stop telling yourself that this is
"Difficult" or "Dangerous". It isn't. But you do have to avoid the
temptation to make "little improvements" along the way.

Somehow, you wound up trying to do this from the Macros dialog, not the VBA
Editor. Not a good place to start: it makes things very difficult :-)

And now you know that you cannot change names in a "set" of macros. You
also know that you cannot change the names of the "Auto..." series macros at
all: or they won't work.

Hope this helps


On 13/12/09 3:20 AM, in article 59bae...@webcrossing.JaKIaxP2ac0,
"kev...@officeformac.com" <kev...@officeformac.com> wrote:

--

0 new messages