Macros in template other than normal

J

Joanne

Hello,
I have a macro that is executed within a document, as a macro button. It
totals the amounts entered into a purchase order. The problem is that
apparently in a field code for running a macro, you can only run a macro that
is stored in Normal.dot and our macros are all stored in a different
template. Is there a way to make the macro button look at a template other
than normal?
Thanks very much for your help.
 
F

fumei via OfficeKB.com

"you can only run a macro that
is stored in Normal.dot "

This is not correct. All macros (procedures) in loaded global templates can
be assigned to a MACROBUTTON.

Using Normal to store, well anything, is not a good idea. I have virtually
all of my macros (procedures) in a global template - VBATools.dot.

All of them can be assigned to a MACROBUTTON.
 
J

Joanne

Thanks for your reply. But when I am inserting a field and I choose "macro
button," the only options I get are for the macros in my normal.dot. How do I
tell Word to display the macros from another template?
 
J

Jay Freedman

The key word in fumei's response is "global". A global template is one that is
stored in Word's Startup folder, and is loaded in the background whenever Word
starts. All macros in a global template are available in all documents, and will
be shown in the list in the Insert > File dialog when you choose MacroButton.
(Normal.dot is a global template in a special way, although it can also be used
as the base for new documents.)

You will also see in the list any macros that are in the template on which the
current document is based, if that isn't Normal.dot.

If you go to Tools > Templates and Add-Ins, click the Add button under "Global
templates and add-ins", and choose any other template, then macros in that
template will become available in the MacroButton list.

You will not _ever_ see in the list any macros in templates that are not global
or an add-in or the document's base.

Does that clarify what you're seeing?

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.
 
J

Joanne

Yes, it does. Thank you!

Jay Freedman said:
The key word in fumei's response is "global". A global template is one that is
stored in Word's Startup folder, and is loaded in the background whenever Word
starts. All macros in a global template are available in all documents, and will
be shown in the list in the Insert > File dialog when you choose MacroButton.
(Normal.dot is a global template in a special way, although it can also be used
as the base for new documents.)

You will also see in the list any macros that are in the template on which the
current document is based, if that isn't Normal.dot.

If you go to Tools > Templates and Add-Ins, click the Add button under "Global
templates and add-ins", and choose any other template, then macros in that
template will become available in the MacroButton list.

You will not _ever_ see in the list any macros in templates that are not global
or an add-in or the document's base.

Does that clarify what you're seeing?

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.
 

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