Word Macro

B

Babu V.T

I need a macro that handle menu events in the MS word
document.
Is it possible to handle menu events in word.
I want to handle the following events.

1) selection of one of the menu items in the
menu that results when clicking "Accept Change" tool
bar button.

2) Selection of menu items in the
menu that results when the user right clicks on a text
portion.

Any suggestion regarding this will be very helpful
 
J

Jezebel

There are two methods you can use --

1. Intercept the Word command by writing a macro of the same name. Go to
Tools > Macro > Macros and select Word Commands from the list to see the
built-in command names. Most names are the same as the menu name plus option
name (eg New on the File menu is called FileNew: if you write a called
FileNew it will run instead of the built-in command).

2. Remove the existing option from the menu and add your own in its place
using the same caption. The menu points to your own macro.
 
J

JGM

Hi Babu!

Careful about Jezebel's second option. If you choose that, you also have to
reassign the possible shortcut associated with that menu item as weel as
toolbar buttons.
For example, if you want to replace Print by your own procedure, you can
remove Print from the file menu, put your own menu choice called Print, but
you have to reassign CTRL-P to your macro, and track down all the Print
buttons on toolbars (the Standard toolbar and the PrintPreview toolbar for
example...)

So when all is saiad, Jezebel's first option is the safest and the easiest.

HTH
Cheers!
 

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