Button Properties

C

Chuck Bowling

I want to be able to change the properties of a toolbar button depending on
the current state the document is in.

For instance, when the user clicks on a button i want it's state (and its
appearance) to change, and other controls to be enabled or disabled on the
toolbar. This would be easy with button events but i have no idea how to
find the name of a custom macro button on a custom toolbar...

Another thing, is it possible to place a spinbutton or other control on a
Word toolbar?
 
P

Perry

Use FindControl() function of the commandbar object to identify
commandbarcontrols

Below statement counters the caption of a control of the Menu bar commandbar
of the commandbarcontrol bearing ID number 30002:

? CommandBars("Menu Bar").FindControl(, 30002).Caption
&File

More info
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaof10/htm
l/ofmthfindcontrol.asp

Once you've identified them, you can toggle the Enabled property or
change other properties.

Krgrds,
Perry
 
C

Chuck Bowling

Excellent... Thanks..


Perry said:
Use FindControl() function of the commandbar object to identify
commandbarcontrols

Below statement counters the caption of a control of the Menu bar commandbar
of the commandbarcontrol bearing ID number 30002:

? CommandBars("Menu Bar").FindControl(, 30002).Caption
&File

More info
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaof10/htm
l/ofmthfindcontrol.asp

Once you've identified them, you can toggle the Enabled property or
change other properties.

Krgrds,
Perry
 

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