M
Mordechai
I'd like to create customized cascading right-mouse context menu(s) in
Visio. I can't use the Shapesheet's Actions section since that doesn't
support cascading pop-ups. I've looked through the UIObject documentation
(including Chapter 22 of DMVS) but it seems to me that UIObjects only
pertain to Menus and Toolbars, not to pop-up context menus - (if I'm missing
something please point me in the right direction).
In any event, this should be very straightforward with CommandBars. If this
were Excel I'd simply get the appropriate pop-up CommandBar with 'set cbBar
= Application.CommandBars("cell")' and then proceed to customize cbBar via
the object model. So I assumed that all I needed was the "name" of the
pop-up CommandBar and I'd be home free. No good - I've dumped all the
CommandBars and can't seem to find any that correspond to any pop-up menus.
Here's the code I used to dump all the CommandBars.
Public Sub dumpbars()
Dim cmdBar As CommandBar, cbCtl As CommandBarControl
For Each cmdBar In Application.CommandBars
Debug.Print "New Bar: " & cmdBar.Name & ", context is ";
cmdBar.Context
For Each cbCtl In cmdBar.Controls
Debug.Print "..." & cbCtl.Caption
Next
Debug.Print
Next
End Sub
Any suggestions. The environment is Visio 2003.
Thanks
Visio. I can't use the Shapesheet's Actions section since that doesn't
support cascading pop-ups. I've looked through the UIObject documentation
(including Chapter 22 of DMVS) but it seems to me that UIObjects only
pertain to Menus and Toolbars, not to pop-up context menus - (if I'm missing
something please point me in the right direction).
In any event, this should be very straightforward with CommandBars. If this
were Excel I'd simply get the appropriate pop-up CommandBar with 'set cbBar
= Application.CommandBars("cell")' and then proceed to customize cbBar via
the object model. So I assumed that all I needed was the "name" of the
pop-up CommandBar and I'd be home free. No good - I've dumped all the
CommandBars and can't seem to find any that correspond to any pop-up menus.
Here's the code I used to dump all the CommandBars.
Public Sub dumpbars()
Dim cmdBar As CommandBar, cbCtl As CommandBarControl
For Each cmdBar In Application.CommandBars
Debug.Print "New Bar: " & cmdBar.Name & ", context is ";
cmdBar.Context
For Each cbCtl In cmdBar.Controls
Debug.Print "..." & cbCtl.Caption
Next
Debug.Print
Next
End Sub
Any suggestions. The environment is Visio 2003.
Thanks