Word toolbar menus

P

petecjr

Using Word built in features (not programming) I created a new custom toobar
and put a menu on the toolbar. Each of the items on the menu call separate
macros I created. I would be able to reduce the macros called down to one if
I knew which menu item had been selected. How do I do this? Thanks for any
help.
 
J

Jonathan West

petecjr said:
Using Word built in features (not programming) I created a new custom
toobar
and put a menu on the toolbar. Each of the items on the menu call
separate
macros I created. I would be able to reduce the macros called down to one
if
I knew which menu item had been selected. How do I do this? Thanks for
any
help.

Hi petecjr

The ActionControl object is the CommandbarControl object which was clicked
to run the macro.

All CommandbarControl objects have a Tag property into which you can put
data that is unique to that button but not displayed. So you can pick up the
Tag of the button that was clicked by reading the ActionControl.Tag
property.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
T

Tony Jollans

CommandBars.ActionControl

... will give you a reference to the button which triggered the code.
 

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