Adding a menu command which will run a macro

A

Amir

Hi!

How can I add a menu command to the Tools bar of Word,
Named "Run My Macro", That will run the macro "Macro1"?

I would like the code to be at the Normal template.

I would like it to check every time Word starts
if there is already such a command in the tools
menu (so that I won't get hundreds of this menu command).

In addition, I would like it to cancel this menu
command before exiting Word, so that if I remove
the code, the command won't stay in the tools menu.


Regards,
Amir.
 
G

Graham Mayor

You should start by renaming your macro to something more descriptive of its
function.

If this macro is to be in your own normal.dot template then the simplest
plan is to add the command to a personal toolbar in normal.dot and then it
will not have to run when you open Word to ascertain whether the command
exists already. If you intend the macro for distribution then create the
macro and toolbar in a global template to which all users have access.
http://www.gmayor.com/installing_macro.htm explains how to add a macro to a
toolbar button.


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
A

Amir

Thank you very much!

Kind Regards,
Amir.

Graham Mayor said:
You should start by renaming your macro to something more descriptive of
its
function.

If this macro is to be in your own normal.dot template then the simplest
plan is to add the command to a personal toolbar in normal.dot and then it
will not have to run when you open Word to ascertain whether the command
exists already. If you intend the macro for distribution then create the
macro and toolbar in a global template to which all users have access.
http://www.gmayor.com/installing_macro.htm explains how to add a macro to
a
toolbar button.


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


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

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