CommandBarEvents

H

haka

Can anybody tell me how to trigger a commandbarevent
I´m usen the following statements but don't know how to continue:

Public WithEvents MenuHandler As CommandBarEvents

Sub BuildMenu(ByVal doc As Visio.IVDocument)
Dim uiObj As Visio.UIObject
Dim menuSetsObj As Visio.MenuSets
Dim menuSetObj As Visio.MenuSet
Dim menusObj As Visio.Menus
Dim menuObj As Visio.Menu
Dim menuItemsObj As Visio.MenuItems
Dim mnuTest1 As Visio.MenuItem

Set uiObj = wdVisioApp.BuiltInMenus
Set menuSetsObj = uiObj.MenuSets
Set menuSetObj = menuSetsObj.ItemAtID(visUIObjSetDrawing)
Set menusObj = menuSetObj.Menus

Set menuObj = menusObj.AddAt(7)
menuObj.Caption = "Gebouwbeheer"
Set menuItemsObj = menuObj.MenuItems

Set mnuTest1 = menuItemsObj.Add
mnuTest1.Caption = "Nieuw niveau"
Set MenuHandler = Visio.Application.EventList.Add(

doc.SetCustomMenus uiObj

End Sub
 
D

David Parker [Visio MVP]

Visio historically had a UIObject model, bu since Microsoft bought it, the
Microsoft Office CommandBars were added.
They are alternative object models for the developer, but they cannot be
mixed. I would use the CommandBars myself, as demonstrated in the SDK code
snippets.
 

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