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

Changing default window properties

369 views
Skip to first unread message

scott....@gmail.com

unread,
Sep 7, 2006, 11:17:39 PM9/7/06
to
Hello,

Is it possible to save the window properties of the office window on
startup. For example, I want to set the default size and position of
the window, so whenever I create a new blank document, the window opens
up with my default specs?

thanks,
Scott

Beth Rosengard

unread,
Sep 8, 2006, 12:21:37 PM9/8/06
to
As far as I know, the answer is no. The size and location of the window is
determined by the size and location of the last window you opened in your
last session in Word. (Or is it the last window you closed? Either way, the
answer is still no.)

Sorry,

--
***Please always reply to the newsgroup!***

Beth Rosengard
MacOffice MVP

Mac Word FAQ: <http://word.mvps.org/Mac/WordMacHome.html>
My Site: <http://www.bethrosengard.com>


On 9/7/06 8:17 PM, in article
1157685459.2...@d34g2000cwd.googlegroups.com,

Daiya Mitchell

unread,
Sep 8, 2006, 1:49:01 PM9/8/06
to
Oh! I think the answer is yes. If you open the Normal template, set the
size, space backspace to convince Word something needs to be saved, then
those settings should carry over to new documents (but not old documents,
and sometimes Word will lose track, so not 100% reliable). I'm not totally
sure about position.

But I got this off WinWord info, and am not sure I have tested it on
MacWord, though I think someone has, I vaguely remember a discussion of this
before.

Also, if you want to mess with macros, you can certainly automate a macro
that will set all windows to open at a certain size, and fixed position.
That's what I do (sorta), because changing the Normal template will not
affect documents that are created by other people and emailed to you.

Scott, post back if you are interested in a macro to do this.


On 9/8/06 9:21 AM, "Beth Rosengard" wrote:

> As far as I know, the answer is no. The size and location of the window is
> determined by the size and location of the last window you opened in your
> last session in Word. (Or is it the last window you closed? Either way, the
> answer is still no.)
>
> Sorry,

--
Daiya Mitchell, MVP Mac/Word
Word FAQ: http://www.word.mvps.org/
MacWord Tips: <http://word.mvps.org/Mac/WordMacHome.html>
What's an MVP? A volunteer! Read the FAQ: http://mvp.support.microsoft.com/

Jacques

unread,
Sep 8, 2006, 2:37:03 PM9/8/06
to
In article <C126FB1D.7571E%daiya...@mvps.org.INVALID>,
Daiya Mitchell <daiya...@mvps.org.INVALID> wrote:

> Also, if you want to mess with macros, you can certainly automate a macro
> that will set all windows to open at a certain size, and fixed position.
> That's what I do (sorta), because changing the Normal template will not
> affect documents that are created by other people and emailed to you.
>
> Scott, post back if you are interested in a macro to do this.
>

Daiya, I'd be interested to see this macro, please.

--
Jacques

CyberTaz

unread,
Sep 8, 2006, 3:21:16 PM9/8/06
to
Borrowed from the irrepressable Elliott Roper:

> Sub ShiftWindow()
> WordBasic.DocMove 3, 1
> WordBasic.DocWindowHeight 975
>
> End Sub
>
>
> This one is creaky old from Word 6 and WordBasic, but works fine. Assign
> to
> a keystroke ---or a toolbar button. Adjust height (975) to suit.
--
Regards |:>)
Bob Jones
[MVP] Office:Mac

"Jacques" <ma...@removethisword.jacques.vispa.com.invalid> wrote in message
news:mail-53A686.1...@news.plus.net...

scott....@gmail.com

unread,
Sep 8, 2006, 3:34:11 PM9/8/06
to
Hi Daiya,

I would be real interested in seeing this macro. Also, I am not too
experienced with using macros in Word, so can you also tell me what I
would need to do in order to have the macro run everytime a new window
or old file is open?

Thanks,
Scott

Phillip Jones

unread,
Sep 8, 2006, 4:45:06 PM9/8/06
to
I see this reference from time to time of removing a space. For the
document to be identical except for desired changes Its actually type a
space, remove a space then save. if you just remove a space you end up
with a possible run on sentence or spacing in bullets or numbering being
incorrect. What you are after is some type of actual change in the
document in order to use "Save" to make the document spacing to be
correct it would be space > backspace. then save.

Daiya Mitchell wrote:
> Oh! I think the answer is yes. If you open the Normal template, set the
> size, space backspace to convince Word something needs to be saved, then
> those settings should carry over to new documents (but not old documents,
> and sometimes Word will lose track, so not 100% reliable). I'm not totally
> sure about position.
>
> But I got this off WinWord info, and am not sure I have tested it on
> MacWord, though I think someone has, I vaguely remember a discussion of this
> before.
>
> Also, if you want to mess with macros, you can certainly automate a macro
> that will set all windows to open at a certain size, and fixed position.
> That's what I do (sorta), because changing the Normal template will not
> affect documents that are created by other people and emailed to you.
>
> Scott, post back if you are interested in a macro to do this.
>
>
> On 9/8/06 9:21 AM, "Beth Rosengard" wrote:
>
>> As far as I know, the answer is no. The size and location of the window is
>> determined by the size and location of the last window you opened in your
>> last session in Word. (Or is it the last window you closed? Either way, the
>> answer is still no.)
>>
>> Sorry,
>

--
------------------------------------------------------------------------
Phillip M. Jones, CET |LIFE MEMBER: VPEA ETA-I, NESDA, ISCET, Sterling
616 Liberty Street |Who's Who. PHONE:276-632-5045, FAX:276-632-0868
Martinsville Va 24112 |pjo...@kimbanet.com, ICQ11269732, AIM pjonescet
------------------------------------------------------------------------

If it's "fixed", don't "break it"!

mailto:pjo...@kimbanet.com

<http://www.kimbanet.com/~pjones/default.htm>
<http://www.kimbanet.com/~pjones/90th_Birthday/index.htm>
<http://www.kimbanet.com/~pjones/Fulcher/default.html>
<http://www.kimbanet.com/~pjones/Harris/default.htm>
<http://www.kimbanet.com/~pjones/Jones/default.htm>

<http://www.vpea.org>

Beth Rosengard

unread,
Sep 8, 2006, 5:03:25 PM9/8/06
to
Well, I was half wrong (or maybe a bit more than that because I forgot about
the macro option :-).

Can you make a changed location stick, because I can't?! In the
experimenting I just did, I could change the size of Normal and that would
stick, but not the location/position.

Beth


On 9/8/06 10:49 AM, in article C126FB1D.7571E%daiya...@mvps.org.INVALID,

Daiya Mitchell

unread,
Sep 8, 2006, 6:34:36 PM9/8/06
to
I can't do it either. After posting I realized I was confused about what the
poster actually wanted, and that was why I had skipped answering the message
the first time around. :) It's sheer luck for me that the macro option
turns out to be true after all, though I have to think harder about it than
I thought. :)

Daiya

--

Daiya Mitchell

unread,
Sep 8, 2006, 6:41:23 PM9/8/06
to
Sloppy writing on my part--I just write "space backspace" instead of
clarifying that I really mean "type a space, then backspace". :)

--

Daiya Mitchell

unread,
Sep 8, 2006, 7:13:49 PM9/8/06
to
Okay, macros for default window properties:

To make a macro run automatically on every new doc, it must be named
AutoNew. To make a macro run automatically on every doc that is opened, it
must be named AutoOpen.

So, usually, your AutoNew and AutoOpen macros would be identical, to affect
every doc you ever see. Save them in Normal or some other global template,
no need to assign to a keyboard or toolbar.

One method in this case:

Since the position and size will be hard coded and adjusted to your monitor,
resolution size, zoom preference, dock position/size, etc, the easiest way
to get the numbers you require will be to record the macro. For instance,
here's a random assortment that I got, and what the macro might look like:

Sub AutoOpen
With ActiveWindow
.Left = 6
.Top = 2
.Width = 479
.Height = 797
End With
End Sub

When you record the macro, I'm not sure if you can name it AutoOpen. If you
can, you might just do that and then repeat the process for AutoNew. (I'm
not willing to mess up my AutoOpen/New macros by testing this. Also, if you
already have AutoOpen/New macros, that might overwrite them, you might check
first). I think you can only have one AutoOpen macro, but it can combine as
many settings as you want (see example below).

So, if you can't name it AutoOpen straight out, then just record it under
any name, e.g. testwindowsize. See Help topic: "Record a Macro" for help
with that. After recording the macro, use Tools | Macros... To see the list,
select your new macro, and click Edit. That will flip you into the Visual
Basic Editor and give you the macro text you need. Change the name of the
macro to Sub AutoNew, then copy the entire macro, paste it, and change the
name of the copy to Sub AutoOpen.

If these directions are confusing, post back with the glitches you ran
into--there are some general references on installing macros here:
http://word.mvps.org/Mac/InstallMacro.html
http://word.mvps.org/Mac/VisualBasicEditor.html
They don't cover this exact case, but could be used to clarify, probably,
rather than wait for an answer.

Daiya

PS. More about forcing window and other preferences below:

Related info‹
my usual AutoOpen and AutoNew macros set View and Zoom, not window position
or size, if anything wants something like this. These commands could be
combined with the sizing/position commands, as in the first example:

Sub AutoNew()
With ActiveWindow.View
.Type = wdNormalView
.Zoom.Percentage = 125
.TableGridlines = True
End With
With ActiveWindow
.Left = 6
.Top = 2
.Width = 479
.Height = 797
End With
End Sub

Sub AutoOpen()
With ActiveWindow.View
.Type = wdNormalView
.Zoom.Percentage = 125
.TableGridlines = True
End With
End Sub

Related Info--
Set the Arrange All menu command to tile windows vertically
http://www.mcgimpsey.com/macoffice/word/verticalwindows.html

Related Info‹
Global Templates
http://www.mcgimpsey.com/macoffice/word/globaltemplate.html

Related Info‹
an AutoExec macro will run every time you *launch* Word. This is good for
making sure application-level preferences always stay set to your liking.

On 9/8/06 12:21 PM, "CyberTaz" wrote:

> Borrowed from the irrepressable Elliott Roper:
>
>> Sub ShiftWindow()
>> WordBasic.DocMove 3, 1
>> WordBasic.DocWindowHeight 975
>>
>> End Sub
>>
>>
>> This one is creaky old from Word 6 and WordBasic, but works fine. Assign
>> to
>> a keystroke ---or a toolbar button. Adjust height (975) to suit.

--

John McGhie [MVP - Word and Word Macintosh]

unread,
Sep 8, 2006, 11:42:22 PM9/8/06
to
Hi Daiya:

AutoOpens can contribute a little "entertainment value" in Word if there is
more than one document already open, due to the time taken to open the next
document.

I find that relying on "activedocument" in an AutoOpen is not always safe,
because the document does not become active until it has completed opening.

I usually get around it this way:

Sub AutoOpen()
Application.OnTime When:=Now + TimeValue("00:00:05"), _
Name:="SetWindowSize"

End sub


Sub SetWindowSize()

With ActiveWindow.View
.Type = wdNormalView
.Zoom.Percentage = 125
.TableGridlines = True
End With

With ActiveWindow
.Left = 6
.Top = 2
.Width = 479
.Height = 797
End With
End Sub

The first macro times out five seconds, then calls the second which actually
does the work. Five seconds may be too long on a fast system. But anything
shorter than 2 seconds is too short :-)

Cheers


On 9/9/06 9:13 AM, in article C127473D.7588C%daiya...@mvps.org.INVALID,
"Daiya Mitchell" <daiya...@mvps.org.INVALID> wrote:

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <jo...@mcghie.name>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410

Jacques

unread,
Sep 10, 2006, 12:18:15 PM9/10/06
to
Daiya, thank you: this works fine if you put the macro in the Normal
template. (It's like magic!) But when I put it in a global template of
my own, I get a "compile error" saying that the name AutoOpen is
"ambiguous".

This seemed to me to imply that Word didn't like the name AutoOpen
because I had already put an (identical) AutoOpen macro in the Normal
template. But that can't be it, because I tried renaming Normal and
restarting Word (so as to restore the original version of Normal without
the AutoOpen macro) and I still get a compile error from the AutoOpen
macro in my own global template -- except that it now says "Compile
error in hidden module: NewMacros".

So is it simply that you can't have a macro called AutoOpen (or
Auto****) in a global template other than Normal? If so, it's no big
deal: I'm just trying to get my head around this stuff.

Jacques
(using Word 2004)

--
Jacques

scott....@gmail.com

unread,
Sep 10, 2006, 2:24:44 PM9/10/06
to
Hi Daiya,

This is great. It works perfect.

I have 2 questions. The reason I originally asked this question to
begin with is because when I open a Word document, for some reason the
window opens with the top flush with the top of the screen, not the top
of the bottom toolbar. Therefore, the top of my window has always been
hidden under the two toolbars I have. Im not sure why it does this and
I was looking for some type of preference to change this.

So, question 1 - do you have any idea why it would do this, or are the
macros you provided the only way for me to move the window?

Question 2 is I created AutoNew and AutoOpen like you described. Both
work except for the original window that opens upon starting Word.
Once Word is open, creating a new window or openining an old file - i
get the position I want. Is there a third macro I would need to get
the original window Word opens to get the same position behavior?

Thanks again for all your help

Scott

Daiya Mitchell

unread,
Sep 10, 2006, 2:45:02 PM9/10/06
to
Thanks, John, very snazzy. Saved in "Useful Macros".

I don't recall ever seeing this timing problem, although it may explain some
oddities previously when I was using Notebook Layout view.

Daiya

--

Daiya Mitchell

unread,
Sep 10, 2006, 2:53:01 PM9/10/06
to
Hi Jacques,

I have no idea (and I'm very novice at macros, so with luck someone else
will chime in on this).

My AutoNew and AutoOpen macros are in Normal, so I haven't tested this. My
AutoExec (which sets some prefs on every launch) is in my Global Macros
template, though, so at least *some* auto macros can be global templates.

If you go into the Visual Basic Editor and select Help, there is a topic
"Auto Macros" that might offer some enlightenment (didn't for me, though).
John McGhie or some other macro expert hopefully will come along and explain
it.

Question--are you seeing the problem with the original new document that
Scott is seeing (where it doesn't run on the first one)? What does your
macro do? (or what is the code?)

Daiya

Daiya Mitchell

unread,
Sep 10, 2006, 3:00:51 PM9/10/06
to
Hi Scott,

On 9/10/06 11:24 AM, "scott....@gmail.com" wrote:
>
> I have 2 questions. The reason I originally asked this question to
> begin with is because when I open a Word document, for some reason the
> window opens with the top flush with the top of the screen, not the top
> of the bottom toolbar. Therefore, the top of my window has always been
> hidden under the two toolbars I have. Im not sure why it does this and
> I was looking for some type of preference to change this.
>
> So, question 1 - do you have any idea why it would do this, or are the
> macros you provided the only way for me to move the window?

Oh, that's a totally different issue. Your toolbars became undocked. If you
float them around and let them drop into the sweet spot, then drop the
document into the sweet spot below them (with a little bitty gap), then Word
would remember the right placement and sort it all out for you henceforth
for the next umpteen launches (until something undocked them again).

No need for macros, really, just to solve that.


>
> Question 2 is I created AutoNew and AutoOpen like you described. Both
> work except for the original window that opens upon starting Word.
> Once Word is open, creating a new window or openining an old file - i
> get the position I want. Is there a third macro I would need to get
> the original window Word opens to get the same position behavior?

No idea at all, I don't see that here, and AutoNew seems to run on my
original new doc, and the VB Help topics on Auto Macros offers no other
candidate to run on a special doc like that.

Jacques, do you see that? Scott, what exact version of Word and OS (intel
or PPC) are you seeing this in?

Some macro expert (because I'm very novice) may chime in, with luck.


>
> Thanks again for all your help

You're welcome.

Daiya

Beth Rosengard

unread,
Sep 10, 2006, 3:33:09 PM9/10/06
to
Hi Scott,

You didn't need the macro to fix that! The problem is that your toolbars
are "undocked". All you need to do is drag them down a little and then
slowly back up until they click into position. Once that happens, the
document window will jump to its proper place below the toolbars.

Not being a macro person myself, you'll have to wait for Daiya on question
2.

--
***Please always reply to the newsgroup!***

Beth Rosengard
MacOffice MVP


On 9/10/06 11:24 AM, in article
1157912684....@i3g2000cwc.googlegroups.com,

Jacques

unread,
Sep 11, 2006, 10:54:28 AM9/11/06
to
Daiya, thanks for pointing me to the VBE help - I hadn't realised that
this was separate from the ordinary Word help. The page on Auto Macros
is indeed helpful. The thing about an AutoOpen (or AutoClose) macro,
apparently, is that it only runs when you open (or close) --
(a) a document or template that contains the macro, or
(b) a document based on a template that contains the macro.
If neither of these is the case, it seems that the macro does not run --
even if it is in the Normal template, or another global template which
is currently loaded. Similarly, an AutoNew macro runs only when you
create a document *based on* a template which contains it -- not merely
because a global template containing it is currently loaded.

Anyway I decided that I was just confusing myself by using another
global template as well as Normal, so in the interests of KISS I have
reverted to using Normal as my only global template for the moment. (I
will try and remember to keep backing it up.)

I have copied the AutoOpen macro to the document template to which most
of my documents are attached, and it seems to work fine if I open one of
these documents.

I have copied the same macro to the Normal template as AutoNew, and it
works fine if I create a new document with Command-N. But yes, I find
the same thing as Scott: AutoNew does *not* run when I start Word up and
it automatically creates a new blank document. (Incidentally I wish it
wouldn't create the new document at all, but I suppose one could create
a macro to close the document immediately, or to stop Word creating it
in the first place.) So maybe a macro relating to the
automatically-created document has to go in AutoExec rather than
AutoNew?

Both my AutoOpen and my AutoNew are essentially the same as the one you
gave in your previous post (but with different numbers).

Thanks very much for your help with this. It's a steep learning curve at
the moment, but I'm determined to show Word who's boss.

Jacques


In article <C129AD1D.75C97%daiya...@mvps.org.INVALID>,

Daiya Mitchell

unread,
Sep 11, 2006, 12:35:34 PM9/11/06
to
Jacques and Scott, can you please both post the exact text of the macro that
does not run on the original new document, and exact OS and Office version
numbers (intel/ppc) for your setup, please?

Also, does the macro work partially, or fail completely?

Thanks, Daiya


Daiya Mitchell

unread,
Sep 11, 2006, 12:35:26 PM9/11/06
to
Hi Jacques,

Thanks much, your investigation is extremely helpful--

On 9/11/06 7:54 AM, "Jacques" wrote:

> Daiya, thanks for pointing me to the VBE help - I hadn't realised that
> this was separate from the ordinary Word help. The page on Auto Macros
> is indeed helpful. The thing about an AutoOpen (or AutoClose) macro,
> apparently, is that it only runs when you open (or close) --
> (a) a document or template that contains the macro, or
> (b) a document based on a template that contains the macro.

Ah ha! Thanks for the restatement, I read that topic, but didn't get it.
So yes, that would mean they need to be in the Normal template, not a global
template.

> If neither of these is the case, it seems that the macro does not run --
> even if it is in the Normal template, or another global template which
> is currently loaded. Similarly, an AutoNew macro runs only when you
> create a document *based on* a template which contains it -- not merely
> because a global template containing it is currently loaded.

"Based on", by the way, is a little loose--my AutoOpen macro runs on all the
documents I open from my students that are based on *their* Normal template.


>
> Anyway I decided that I was just confusing myself by using another
> global template as well as Normal, so in the interests of KISS I have
> reverted to using Normal as my only global template for the moment. (I
> will try and remember to keep backing it up.)

I've got an Applescript that copies certain files like that to a Backup
location, which I try to remember to run from the OS menu every day. Quick
and dirty, but easy enough it gets done.


>
> I have copied the AutoOpen macro to the document template to which most
> of my documents are attached, and it seems to work fine if I open one of
> these documents.

It might also be worth creating the macro as ResizeWindow for manual
triggering when necessary.


>
> I have copied the same macro to the Normal template as AutoNew, and it
> works fine if I create a new document with Command-N. But yes, I find
> the same thing as Scott: AutoNew does *not* run when I start Word up and
> it automatically creates a new blank document. (Incidentally I wish it
> wouldn't create the new document at all, but I suppose one could create
> a macro to close the document immediately, or to stop Word creating it
> in the first place.)

Nothing you can do about that first new document, sorry. I wouldn't try to
stop Word creating it, but the macro to close it could work. You could try
to develop the habit of launching Word by double-clicking an existing doc
(then that blank doc doesn't come up).

>So maybe a macro relating to the
> automatically-created document has to go in AutoExec rather than
> AutoNew?

Let us know what happens when you try it. :) The thing is, different
properties behave differently--for instance, I always get the right Zoom and
View on launch, but technically, I shouldn't need a macro to get those
anyhow, so I don't know if it's really the macro kicking in. But I think
you are only seeing this because you want position and size, which seem to
operate differently. In fact, based on that logic, the sizing ought to come
out right, but not the position?

Also, you might review the timing trick that John McGhie posted on this
thread, to give a delay before the macro runs.


>
> Both my AutoOpen and my AutoNew are essentially the same as the one you
> gave in your previous post (but with different numbers).
>
> Thanks very much for your help with this. It's a steep learning curve at
> the moment, but I'm determined to show Word who's boss.

That's the right attitude! the only path toward peace with Word, really. :)

Daiya

scott....@gmail.com

unread,
Sep 11, 2006, 1:14:30 PM9/11/06
to
Daiya,

I run Office 2004 on Mac Powerbook (ppc) running OS 10.3.9.

I copied your macro exactly for both AutoOpen and AutoNew()

Sub AutoNew()

With ActiveWindow.View
.Type = wdNormalView
.Zoom.Percentage = 125
.TableGridlines = True
End With

With ActiveWindow


.Left = 6
.Top = 2
.Width = 479
.Height = 797
End With
End Sub

whitecloud1

unread,
Sep 11, 2006, 2:05:25 PM9/11/06
to

Hi, I'm joining this discussion. Following your postings, I managed to
set the default size and location for any new or opened document. i.e.
if I press Command+N it's perfect, or open any file. The only minor
problem now is when I Launch Word, then the default or Normal document
isn't aligned as in the macro settings. Even selecting new from Project
Gallery is perfect. Is there something I overlooked?
Best wishes,
JB

PS. Renaming macros can be done by copying and pasting the new name on
top of the old in the VB browser tab below. Trying to delete existing
name will cause shutdown of Word.

Jacques

unread,
Sep 11, 2006, 2:30:01 PM9/11/06
to
In article <C12ADE5E.75E90%daiya...@mvps.org.INVALID>,
Daiya Mitchell <daiya...@mvps.org.INVALID> wrote:

> > I have copied the AutoOpen macro to the document template to which most
> > of my documents are attached, and it seems to work fine if I open one of
> > these documents.
>
> It might also be worth creating the macro as ResizeWindow for manual
> triggering when necessary.

There's no need: it seems you can run an Auto macro manually if you
want. I'll give it a keyboard shortcut.

> >
> > I have copied the same macro to the Normal template as AutoNew, and it
> > works fine if I create a new document with Command-N. But yes, I find
> > the same thing as Scott: AutoNew does *not* run when I start Word up and
> > it automatically creates a new blank document. (Incidentally I wish it
> > wouldn't create the new document at all, but I suppose one could create
> > a macro to close the document immediately, or to stop Word creating it
> > in the first place.)
>
> Nothing you can do about that first new document, sorry. I wouldn't try to
> stop Word creating it, but the macro to close it could work. You could try
> to develop the habit of launching Word by double-clicking an existing doc
> (then that blank doc doesn't come up).

But I want Word to adapt to my working practices, not the other way
round : )



> >So maybe a macro relating to the
> > automatically-created document has to go in AutoExec rather than
> > AutoNew?
>
> Let us know what happens when you try it. :)

I get an error message: apparently Word can't do anything with the
active document because there isn't an active document yet. Figures.

> Also, you might review the timing trick that John McGhie posted on this
> thread, to give a delay before the macro runs.

Thanks, I will. I didn't understand it at first, but now I think I do.
Progress.

Jacques

Jacques

unread,
Sep 11, 2006, 2:34:56 PM9/11/06
to
Sub AutoNew()
With ActiveWindow
.Left = 0
.Top = 0
.Width = 1443
.Height = 1028
End With
End Sub

OS 10.3.9
Office 2004 v. 11.2
original (ppc) Mac mini

Word appears to ignore the macro. There is no error message. The
document just opens at the wrong size.

Jacques


In article <C12ADE66.75E90%daiya...@mvps.org.INVALID>,

Daiya Mitchell

unread,
Sep 11, 2006, 4:31:24 PM9/11/06
to
Hi JB,

On 9/11/06 11:05 AM, "whitecloud1" wrote:

>
> Hi, I'm joining this discussion. Following your postings, I managed to
> set the default size and location for any new or opened document. i.e.
> if I press Command+N it's perfect, or open any file. The only minor
> problem now is when I Launch Word, then the default or Normal document
> isn't aligned as in the macro settings.

And can you also post the exact text of your macro and details of Office and
OS version numbers?

> Even selecting new from Project
> Gallery is perfect.

Ooh, interesting piece of new info. Thanks.

>Is there something I overlooked?

Trying to figure that out now, info requested above helpful.

> Best wishes,
> JB
>
> PS. Renaming macros can be done by copying and pasting the new name on
> top of the old in the VB browser tab below. Trying to delete existing
> name will cause shutdown of Word.

Oops. Thanks for the heads-up.

John McGhie [MVP - Word and Word Macintosh]

unread,
Sep 11, 2006, 6:05:49 PM9/11/06
to
Hi Jacque:

What do YOU mean by "Global Template"? A global template MUST be in the
Word Startup folder: nowhere else. Distinguish this from an "Attached
Template" which can be anywhere.

Your compile error is because you have bad code in the named module. If
it's an ambiguous name, then it's in the same template.

You can have multiple macros named AutoOpen, provided you have only ONE in
each template :-)

You can have (and sometimes, "should" have) more than one macro of the same
name in your current context. Your current context encompasses the
document, its attached template, its global template(s) and Normal template.

However, Word searches back down the hierarchy and executes only one copy:
the one closest in context to the active document. The hierarchy is:

1) Active Document
2) Attached Template
3) Global Templates
4) Normal Template

Cheers

On 11/9/06 2:18 AM, in article mail-951DBE.1...@news.plus.net,
"Jacques" <ma...@removethisword.jacques.vispa.com.invalid> wrote:

--

Please reply to the newsgroup to maintain the thread. Please do not email


me unless I ask you to.

John McGhie <jo...@mcghie.name>
Microsoft MVP, Word and Word for Macintosh. Business Analyst, Consultant
Technical Writer.

Paul Berkowitz

unread,
Sep 11, 2006, 10:16:54 PM9/11/06
to
On 9/11/06 7:54 AM, in article mail-858088.1...@news.plus.net,
"Jacques" <ma...@removethisword.jacques.vispa.com.invalid> wrote:

> The page on Auto Macros
> is indeed helpful. The thing about an AutoOpen (or AutoClose) macro,
> apparently, is that it only runs when you open (or close) --
> (a) a document or template that contains the macro, or
> (b) a document based on a template that contains the macro.
> If neither of these is the case, it seems that the macro does not run --
> even if it is in the Normal template, or another global template which
> is currently loaded. Similarly, an AutoNew macro runs only when you
> create a document *based on* a template which contains it -- not merely
> because a global template containing it is currently loaded.


As best I recall, AutoNew does not work in Mac Word. Nor any of the other
Auto macros except for AutoOpen.

I have this installed in my Normal template:


Sub AutoOpen()
On Error Resume Next
ActiveWindow.View.Zoom.Percentage = 125
End Sub


It works to set the view to 125% on every new document I open - via cmd-N,
or any other way, including the blank new document that opens when launching
Word.

Yes, it must be in your Normal template, since that is what is used to make
new blank documents. As John says, you should not have macros with the same
name in more than one global template.

I have several other macros in a template I keep in the Startup folder
(which I keep in a safe place and alias to the correct location). I agree
with John that, in genera;, it's safer to keep templates in such a startup
template rather than Normal. But the new blank document that is created when
Word is launched opens _before_ any startup template. That's why it wasn't
working for you. This one needs to be in Normal and nowhere else.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.

Jacques

unread,
Sep 12, 2006, 6:31:40 AM9/12/06
to
In article <C12B66A6.DDF24%berkowit@spoof_silcom.com>,
Paul Berkowitz <berkowit@spoof_silcom.com> wrote:

> On 9/11/06 7:54 AM, in article mail-858088.1...@news.plus.net,
> "Jacques" <ma...@removethisword.jacques.vispa.com.invalid> wrote:
>
> > The page on Auto Macros
> > is indeed helpful. The thing about an AutoOpen (or AutoClose) macro,
> > apparently, is that it only runs when you open (or close) --
> > (a) a document or template that contains the macro, or
> > (b) a document based on a template that contains the macro.
> > If neither of these is the case, it seems that the macro does not run --
> > even if it is in the Normal template, or another global template which
> > is currently loaded. Similarly, an AutoNew macro runs only when you
> > create a document *based on* a template which contains it -- not merely
> > because a global template containing it is currently loaded.
>
>
> As best I recall, AutoNew does not work in Mac Word. Nor any of the other
> Auto macros except for AutoOpen.

AutoNew works fine for me in Word 2004, except that it doesn't work for
the document that Word creates on starting up. I haven't tried the
others.

Jacques

unread,
Sep 12, 2006, 6:55:39 AM9/12/06
to
In article <C12C1ADD.4B868%jo...@mcghie.name>,
"John McGhie [MVP - Word and Word Macintosh]" <jo...@mcghie.name>
wrote:

> What do YOU mean by "Global Template"? A global template MUST be in the
> Word Startup folder: nowhere else. Distinguish this from an "Attached
> Template" which can be anywhere.

Hi John. The global template into which I tried to put an AutoOpen macro
was in fact in my Word Startup folder. But I'm surprised that you say a
global template MUST be there. In Tools>Templates and Add-ins there are
the options (a) to attach a document template, or (b) to add a global
template which is not already loaded. I just tried adding (as a global
template, not the document template) a template from outside the Startup
folder, and it seemed to work OK. Does Word use the term "global
template" in two different senses, sometimes including a template added
after start-up and sometimes not? Does a global template added after
start-up (if such a thing exists) behave differently from one loaded on
start-up?



> Your compile error is because you have bad code in the named module. If
> it's an ambiguous name, then it's in the same template.
> You can have multiple macros named AutoOpen, provided you have only ONE in
> each template :-)

Sorry, I don't understand that. It was the same code that worked OK if
put in the Normal template. And it was the only macro I had put in the
global template. But I'm certainly confused about "macro projects",
"modules", "procedures" etc. The Missing Manual isn't much help on this,
but I've ordered a couple of Woody Leonhard's books on Winword 2000
which I hope will make things clearer.

John McGhie [MVP - Word and Word Macintosh]

unread,
Sep 12, 2006, 7:13:40 AM9/12/06
to
What Paul says is correct: AutoNew won't work for the blank document
because it doesn't fire the DocumentNew event.

It does fire the AutoExec macro and that's the one to use for the blank
document.

I use a routine named "SetToolbars" that replaces the standard toolbars with
ones of my own invention. Here's how I call it:

Sub AutoExec()
Call SetToolbars
End Sub
Sub AutoOpen()
Call SetToolbars
End Sub
Sub AutoNew()
Call SetToolbars
End Sub
Sub AutoClose()
Call SetToolbars
End Sub
Sub AutoExit()
Call SetToolbars
End Sub


As you can see, that same macro is called on every document change event.
The reason is that it both reveals my custom toolbars and removes them
before exiting.

Cheers

, "Jacques" <ma...@removethisword.jacques.vispa.com.invalid> wrote:

--

Daiya Mitchell

unread,
Sep 12, 2006, 10:08:05 AM9/12/06
to
On 9/12/06 4:13 AM, "John McGhie [MVP - Word and Word Macintosh]" wrote:

> What Paul says is correct: AutoNew won't work for the blank document
> because it doesn't fire the DocumentNew event.

Aha. John, *thank* you for settling this. :)

Sorry for my error, all! I picked the AutoNew/AutoOpen info up from WinWord
and never specifically clarified it for the Mac. It appears to work on my
machine, but that's just a coincidence.

Daiya

John McGhie [MVP -- Word and Word Mac]

unread,
Sep 13, 2006, 3:49:21 AM9/13/06
to
Hi:

Top-posting if you can... WHen we're in a hurry, it saves all that
scrolling :-)

> Hi, I'm joining this discussion.

Welcome!

> Following your postings, I managed to
> set the default size and location for any new or opened document. i.e.
> if I press Command+N it's perfect, or open any file. The only minor
> problem now is when I Launch Word, then the default or Normal document
> isn't aligned as in the macro settings.

If you're talking about toolbar alignment, that's right. There's a bug in
Mac Word VBA that ignores the positioning statements for toolbars. Sorry,
no cure!

> Even selecting new from Project
> Gallery is perfect. Is there something I overlooked?

No. It's a bug.

> Best wishes,
> JB
>
> PS. Renaming macros can be done by copying and pasting the new name on
> top of the old in the VB browser tab below. Trying to delete existing
> name will cause shutdown of Word.

Well, true, but I would strongly advise people NOT to get into the habit of
re-naming macros. You'll get into a world of hurt in larger projects doing
that :-)

Create them with the names you intend to use: make them descriptive :-)

--

John McGhie <jo...@mcghie.name>
Consultant Technical Writer, Microsoft MVP (Word, Word for Mac)
Sydney, Australia +61 (0)4 1209 1410

"whitecloud1" <jbo...@oceanfree.net> wrote in message
news:1157997925.5...@m73g2000cwd.googlegroups.com...


John McGhie [MVP -- Word and Word Mac]

unread,
Sep 13, 2006, 4:07:07 AM9/13/06
to
Hi Jacque:

"Jacques" <ma...@removethisword.jacques.vispa.com.invalid> wrote in message
news:mail-87E856.1...@news.plus.net...


> In article <C12C1ADD.4B868%jo...@mcghie.name>,
> "John McGhie [MVP - Word and Word Macintosh]" <jo...@mcghie.name>
> wrote:
>
>> What do YOU mean by "Global Template"? A global template MUST be in the
>> Word Startup folder: nowhere else. Distinguish this from an "Attached
>> Template" which can be anywhere.
>
> Hi John. The global template into which I tried to put an AutoOpen macro
> was in fact in my Word Startup folder. But I'm surprised that you say a
> global template MUST be there. In Tools>Templates and Add-ins there are
> the options (a) to attach a document template, or (b) to add a global
> template which is not already loaded. I just tried adding (as a global
> template, not the document template) a template from outside the Startup
> folder, and it seemed to work OK. Does Word use the term "global
> template" in two different senses, sometimes including a template added
> after start-up and sometimes not? Does a global template added after
> start-up (if such a thing exists) behave differently from one loaded on
> start-up?

Ah! My mistake. I neglected to mention that you can load Global Templates
using that dialog. I don;t use it, because it can be unreliable (if the
gloabl template is not found on next Word startup, it will not be loaded,
and then won't load correctly in future. So I like to put them all in
Startup so I know where they are :-)

The distinction is that a Global Template (Whether loaded from Startup or by
Templates>Add...) is loaded by the application, before any documents load,
and is available to all documents that are open.

The Attached Template is loaded AFTER the document which calls it loads, and
resources within it are NOT available to any other documents that may be
open (unless they Attach the same template).

Whereas the NORMAL template is either loaded or created by the application
before anything else loads, and its resources are also available to all open
documents.

Normal is basically the "Lender of Last Resort" which is always guaranteed
to be present and is the last place Word looks for things. So you can have
an AutoOpen in Normal and one in the Global template and one in the Attached
Template, all with the same name. The one that runs will be the one in the
Attached Template.

This is worth remembering, although it's risky, it can be useful: You can
have multiple macros of the same name in context, provided they are in
different templates. Only ONE of them will AUOT-run: the one in closest
context.

You CAN override this context by explicitly calling the macro you want from
a named template, but for god's sake DON'T -- nobody will be able to
maintain your code -- including YOU!!

And don't go spending money on books on VBA for the Mac. All VBA on the Mac
will go away in a few months! Spend your money on AppleScript books.


>
>> Your compile error is because you have bad code in the named module. If
>> it's an ambiguous name, then it's in the same template.
>> You can have multiple macros named AutoOpen, provided you have only ONE
>> in
>> each template :-)
>
> Sorry, I don't understand that. It was the same code that worked OK if
> put in the Normal template. And it was the only macro I had put in the
> global template. But I'm certainly confused about "macro projects",
> "modules", "procedures" etc. The Missing Manual isn't much help on this,
> but I've ordered a couple of Woody Leonhard's books on Winword 2000
> which I hope will make things clearer.

I know the "Missing Manual" series is highly revered, but I found that the
thing that is mainly missing in my copy of one of them is "content" :-)

The error "ambiguous name" does not necessarily mean the name of a macro, it
can be the name of anything, such as a variable. The VBA compiler compiles
the whole Project: names must be unique within the project.

A "Project" is a "Template" for our purposes. A "Module" is a a collection
of macros: the thing that appears in the left column of the VBA Editor:
"NewMacros is an example, the default module created when you record things.
A "Procedure" is a single macro. "Sub" stands for "Subprocedure". There
are several other flavours: Functions are the one you will see most often.

Cheers

Jacques

unread,
Sep 13, 2006, 5:41:34 AM9/13/06
to
In article <OIzdcuw1...@TK2MSFTNGP02.phx.gbl>,

Understood. Loading global templates after startup is yet another of
those options that Word offers, but you shouldn't accept.

> And don't go spending money on books on VBA for the Mac. All VBA on the Mac
> will go away in a few months! Spend your money on AppleScript books.

My top priority at the moment is to stop Word 2004 getting in my way (by
resizing my windows, shoving unwanted toolbars at me etc), and VBA seems
to be the simplest way of doing this. Would you agree? If so, I'll get
round to learning AppleScript later. I don't expect to be upgrading at
the first opportunity. If I hadn't switched to a Mac I'd still be using
Word 97.

> > I'm certainly confused about "macro projects",
> > "modules", "procedures" etc. The Missing Manual isn't much help on this,
> > but I've ordered a couple of Woody Leonhard's books on Winword 2000
> > which I hope will make things clearer.
>
> I know the "Missing Manual" series is highly revered, but I found that the
> thing that is mainly missing in my copy of one of them is "content" :-)

I found the ones on OS X and GarageBand helpful, but the Office one is
disappointingly Microsoftian. It doesn't even warn you not to use Fast
Saves! I prefer Woody's tell-it-like-it-is approach. His Underground
Guide was what enabled me to get a grip on WinWord 6. Besides, you can
pick up books on Office 2000 pretty cheap now ...

little_creature

unread,
Sep 23, 2006, 3:04:05 PM9/23/06
to
Hi,
You can by macro. I'm on PC now so I will not give you exact solution
just some tips:
1. start macros recorning
2. resize your window to size you like
3. stop macros recording
4. have a look on your macro at VBA, you should end up with something
like this:

Private Sub scale_down()
With ActiveWindow
.Width = 882
.Height = 675
End With
End Sub

scott....@gmail.com said the following on 8.9.2006 5:17:
> Hello,
>
> Is it possible to save the window properties of the office window on
> startup. For example, I want to set the default size and position of
> the window, so whenever I create a new blank document, the window opens
> up with my default specs?
>
> thanks,
> Scott
>

jwels...@gmail.com

unread,
Apr 30, 2014, 10:25:20 AM4/30/14
to
Maximize the window size. Then press and hold "Ctrl" as you click the X on the window. It will save this as the default.
0 new messages