Toolbars-customizing

K

klav

Once you add a button to a toolbar for a macro you've created and you change
the text on the button, is there any way to know what macro it is executing?
 
J

Jonathan West

klav said:
Once you add a button to a toolbar for a macro you've created and you
change
the text on the button, is there any way to know what macro it is
executing?

The macro executed is stated in the OnAction property of the
CommandBarButton object. This is accessible via VBA, but nothing in Tools
Customize will give it to you directly.

--
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
 
J

John Finlay

Actually, if you open Tools Customize, then right click on the button in
question and select "Assign Macro", this should reveal the current macro
assigned.
 
J

John Finlay

I was at a customer's site, they have Word 2003. I opened the
Toolbars-customize window and left it open. I then right-clicked on the
actual icon on the toolbar and chose "Assign Macro".

However, after posting yesterday, I did the same thing on my pc with Word
2003, and there is no such thing as "Assign Macro".

I think I need...yes...more coffee!

Sorry for the confusion, I'll return to that customer today or tomorrow and
see if I can find out what is different on their pc.
 
J

Jonathan West

Hi John,

Thanks for following this up. I'll be very interested to learn whatever you
can find out about that customer's setup and how they get to have an Assign
Macro button!

--
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
 
K

Kerry

Jonathan West said:
The macro executed is stated in the OnAction property of the
CommandBarButton object. This is accessible via VBA, but nothing in Tools
Customize will give it to you directly.

It would be very useful to be able to see which macro is assigned to a
toolbar control!

The Commandbars object structure is very confusing. I have been able to
list the controls of the menubar (ie the words across the top), but cannot
get access to the items in the menus that drop down in order to be able to
read their OnAction. Does anyone understand the structure of the CommandBars
and Controls?

It would be nice to have some code that lists all the submenu items for a
specific toolbar together with their OnAction and if poss their relation to
the other menu level items. Has anyone done this?

Kerry
 

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