April 2006
Beginner
1114 pages
98h 16m
English
commandbarbutton.State [= msoButtonState]
Sets or returns the interactive state of the control. This property is read-only for built-in commands. Can be one of these settings:
msoButtonDown
msoButtonMixed
msoButtonUp
For menu items, msoButton down places a check mark beside the item’s caption; msoButtonUp removes the check mark. The following code toggles the selection of a menu item:
Sub ShowCodeHelper( )
Dim cbc As CommandBarButton
' Get the menu item
Set cbc = CommandBars("Worksheet Menu Bar").FindControl( _
, , "mnuCodeHelper", , True)
' Toggle the state (adds or removes a check mark
' beside the menu item).
cbc.State = Not cbc.State
End SubRead now
Unlock full access