Running a macro at Word startup

  • Thread starter Thread starter Rick Charnes
  • Start date Start date
R

Rick Charnes

I'd like a macro to run when Word 2003 starts. I'm confused, though:
one set of instructions says to name a macro AUTOEXEC and save it to
NORMAL.DOT. Another says that macros to be launched at startup should
be placed in Word's \STARTUP folder. Which of these two is correct?

And if the latter, I'm not sure how to place a macro in the \STARTUP
folder -- do I create a separate template and place it there? What do I
name the template? Does it matter what I name the macro?

Thanks.
 
You create an AutoExec macro. It can be in normal.dot or in a different
template that is kept in Word's startup folder. My preference is to keep my
customizations in a different template.

See http://addbalance.com/word/movetotemplate.htm for step-by-step
instructions on moving / sharing / copying / backing-up customizations
including AutoText, AutoCorrect, keyboard assignments, toolbars, macros,
etc.
--

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
Hmmm... I just put a macro named AutoExec in NORMAL.DOT and it doesn't
load when Word starts. I tried creating a different macro named
AutoExec and saved it to a new template which I then put in Word's
\STARTUP folder -- but that also doesn't execute. Help!

Possible clue: I see I do have WFWORD2K.DOT installed as an add-in
seemingly for *all* Office apps -- and it has its own AutoExec macro.
WFWORD2K.DOT is sitting in the folder that Word specifies for 'Tools' in
the File Locations tab:
C:\Program Files\Microsoft Office\OFFICE11\Startup\

Any thoughts?
 
What is this macro supposed to do?
Having two autoexec macros in different templates should not be an issue,
but wfword2K.dot is the Winfax add-in for Word 2000 and does not work
reliably with Word 2003. I would remove that (unless you are using it for
mail merge and are having no problems with it) and use the method at
http://www.gmayor.com/fax_from_word.htm to send faxes.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Back after vacation...

This macro types "Good morning, Rick!" on the screen.

I've unchecked WFWORD2K.DOT in the 'Templates and Add-ins' dialog. I
have checked my new TRYTHIS.DOT, inside of which is my macro named
AutoExec that types "Good morning, Rick". But when I load Word, the
macro doesn't run.

Possible clue: when I go to execute it manually from the Macros dialog,
I noticed that the Edit, Create and Delete buttons are all disabled.
And when I choose 'Step into', Word tells me "Project is unviewable".
Any thoughts?
 
Did you put the Add-In in your Word Startup folder? Just loading it and
checking it in the dialog won't change Word's behavior at startup; it needs
to be in the folder.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
Simply unchecking/unchecking the add-ins will not necessarily alter their
behaviour when Word starts. The add-ins must be in the Word startup folder
as defined at tools > options > file locations > startup. In the case of the
Winfax macro this must be removed from that folder to disable it completely.

As for the autoexec macro, if you have no one else to say Good morning to
you then

Sub AutoExec()
MsgBox "Good morning, Rick!"
End Sub

will do the trick :(

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Thanks. I've removed WFWORD2K.DOT completely.

My TRYTHIS.DOT is in the startup folder, it's checked in the "Templates
and Add-ins" dialog, it contains a macro named AutoExec, but it's not
executing on Word startup.

I'm very new at this and have a feeling that I'm not creating my
templates correctly and/or the templates are not holding macros
correctly. In the VBA Editor, I see that the template in my startup
folder is considered a 'Project' rather than a 'Template Project' and
when I click on it to look at my macro, it says 'Project is Unviewable'.

Help! I have a feeling I need a long lesson about macros and
templates... :-)
 
Have you tried running your macro from the vba editor or from Word to see if
it runs at all?

The behavior of it being unviewable is regular behavior. To make it
viewable, you actually have to open the template for editing.

The name of "Project" vs. "Template Project" tells me that when you
initially saved the macros, you were working in a document rather than a
template. How did it get the name TRYTHIS.DOT? Did you save as a template
from Word or simply rename it by changing the extension in Windows? (If the
latter, you don't want to do this.)
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
Thanks. I've recreated the whole process, ensuring that TRYTHIS.DOT is
a genuine template rather than a document, then saving the AutoExec
macro to this. It now correctly shows up as a 'Template Project'. The
AutoExec macro inside TRYTHIS.DOT executes perfectly from either Word or
the VBA editor, but doesn't run when Word starts.

A thought: I have Adobe Acrobat installed, which probably does all sorts
of ugly things to Word. Could this be related?
 
How are you starting Word? - and is Word already running because you are
using it as an editor for Outlook?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top