Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

Adding a menu command which will run a macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Amir - 20 Mar 2005 13:52 GMT
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.
Graham Mayor - 20 Mar 2005 14:19 GMT
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.

Signature

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Hi!
>
[quoted text clipped - 13 lines]
> Regards,
> Amir.
Amir - 20 Mar 2005 15:10 GMT
Thank you very much!

Kind Regards,
Amir.

> You should start by renaming your macro to something more descriptive of
> its
[quoted text clipped - 26 lines]
>> Regards,
>> Amir.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.