Executing Button Commands of Buttons not in a CommandBar

C

Cory

Good morning,

I am attempting to use the .execute function of a number of CommandBar
buttons, and some are not in a command bar. Now I could add them to a
commandbar, but I do not want to unnecessarily mess with the users settings
by adding/deleting commandbars. Is there a way to issue the .execute for a
button that is not in the commandbar? All of these commands (so far) appear
in the menu (which is a commandbar) but for whatever reason the .controls
sub-collection does not appear to be in the .controls collection as in:
Application.CommandBars(1).Controls(3).Controls(5).Execute
Thus would I be able to execute the 5th item in the view menu. It doe not
appear that publisher works this way however. It shows up in the pop-up
dropdown box in Excel and Word VBA, but not Publisher.... yet another
example of the hodge-podge VBA implementation in Pub2002.

Please tell me that Publisher 2007 is better in this regard! With the way
my company works, we may have 2007 by the end of the next decade...
Something to look forward to.

Cory
 
E

Ed Bennett

Cory said:
Thus would I be able to execute the 5th item in the view menu. It doe not
appear that publisher works this way however. It shows up in the pop-up
dropdown box in Excel and Word VBA, but not Publisher.... yet another
example of the hodge-podge VBA implementation in Pub2002.

It doesn't show up in IntelliSense in Publisher 2007, but it DOES work.
Just tested it myself.
 
C

Cory

Hmm I must have mistypes something somewhere then... Thank you. I will go
over my code and check it out.
 

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