S
Shahzad Godil
I have added one Custom menu in shape context menuset using this code. Menu
is appearing but I want to get click event of this button in my vb.net
application using Visio ActivexControl.
Thanks
Shahzad Godil
Public Sub MenuItem_Add()
Dim uiObj As UIObject
Dim visMenuSets As MenuSets
Dim visMenuSet As MenuSet
Dim visMenus As Menus
Dim visMenu As Menu
Dim visMenuItems As MenuItems
Dim visMenuItem As MenuItem
uiObj = objApp.BuiltInMenus
visMenuSets = uiObj.MenuSets
' Get the Visio object context menu set.
visMenuSet =
visMenuSets.ItemAtID(VisUIObjSets.visUIObjSetCntx_DrawObjSel)
visMenus = visMenuSet.Menus
' Get the file menu from the menus collection.
visMenu = visMenus.Item(0)
' Get the items collection from the file menu
visMenuItems = visMenu.MenuItems
' Add Example Menu Item to the File menu in the 4th position
visMenuItem = visMenuItems.AddAt(3)
visMenuItem.Caption = "Example"
visMenuItem.State = VisUIButtonState.visButtonUp
' Have Example run the HelloWorld Sub procedure
visMenuItem.AddOnName = "ThisDocument.HelloWorld"
' Set the new menus.
objApp.SetCustomMenus(uiObj)
' Tell Visio to use the new UI when the document is active.
objDocument.SetCustomMenus(uiObj)
End Sub
End Sub
is appearing but I want to get click event of this button in my vb.net
application using Visio ActivexControl.
Thanks
Shahzad Godil
Public Sub MenuItem_Add()
Dim uiObj As UIObject
Dim visMenuSets As MenuSets
Dim visMenuSet As MenuSet
Dim visMenus As Menus
Dim visMenu As Menu
Dim visMenuItems As MenuItems
Dim visMenuItem As MenuItem
uiObj = objApp.BuiltInMenus
visMenuSets = uiObj.MenuSets
' Get the Visio object context menu set.
visMenuSet =
visMenuSets.ItemAtID(VisUIObjSets.visUIObjSetCntx_DrawObjSel)
visMenus = visMenuSet.Menus
' Get the file menu from the menus collection.
visMenu = visMenus.Item(0)
' Get the items collection from the file menu
visMenuItems = visMenu.MenuItems
' Add Example Menu Item to the File menu in the 4th position
visMenuItem = visMenuItems.AddAt(3)
visMenuItem.Caption = "Example"
visMenuItem.State = VisUIButtonState.visButtonUp
' Have Example run the HelloWorld Sub procedure
visMenuItem.AddOnName = "ThisDocument.HelloWorld"
' Set the new menus.
objApp.SetCustomMenus(uiObj)
' Tell Visio to use the new UI when the document is active.
objDocument.SetCustomMenus(uiObj)
End Sub
End Sub