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
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