Word 2003 Template Macros

J

James

Hi, I want to create a document template that contains some VBA code to
create a custom toolbar.

I want this to run when:

1. A user creates a new document from the template, or
2. A user opens an existing document created from the template.

I know I can put VBA code in the Document_New and Document_Open events to
make this happen, but one annoying consequence of this is that the VBA code
fires when I open the template to make changes to it.

Is there a way to detect when the I am opening the template itself for
editing and prevent the VBA code from running?
 
G

GeoffG

Hold down the Shift key when you open the template.
The Shift key prevents all Auto macros from running.

For more information, check out the following article.
It's for Word 2000, but perhaps the same applies for your version
of Word.

See 2nd paragraph under "More Information" in the following
article:
http://support.microsoft.com/kb/211659

Regards
Geoff
 

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

Top