K
Kevin Ayton
Can one of the experts out there help me with this?
I have a Visio application that worked fine under Visio 2000. When I opened
the document I added a custom menu with a number of items.
I've now upgraded to Visio 2003, and while the menu gets created, the items
on the menu are greyed out and can't be actioned. What do I need to change?
Code sample below:
Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
' Add menu with a number of items....
Dim UIObj As Visio.UIObject
Dim menuObj As Visio.Menu
Dim menuitemObj As Visio.MenuItem
Set UIObj = Visio.Application.BuiltInMenus
' Insert new menu after Tools
Set menuObj = UIObj.MenuSets.ItemAtID(visUIObjSetDrawing).Menus.AddAt(7)
menuObj.Caption = "My Menu"
' Add item - Asset Properties
Set menuitemObj = menuObj.MenuItems.Add
With menuitemObj
.Caption = "Asset Properties..."
'.CmdNum = 0
.Enabled = True
.ActionText = "Display properties of the selected assets"
.AddOnName = "frmProperties.Display"
End With
' <snip - repeat several times, for each item>
' Now display the modified menu for this document...
ThisDocument.SetCustomMenus UIObj
'Instantiate the linked database
Set adbAssetDB = New AssetDB
End Sub
I know the code is being executed, becaus if I comment it out, the menu is
not added.
Thanks in Advance
Kevin
I have a Visio application that worked fine under Visio 2000. When I opened
the document I added a custom menu with a number of items.
I've now upgraded to Visio 2003, and while the menu gets created, the items
on the menu are greyed out and can't be actioned. What do I need to change?
Code sample below:
Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
' Add menu with a number of items....
Dim UIObj As Visio.UIObject
Dim menuObj As Visio.Menu
Dim menuitemObj As Visio.MenuItem
Set UIObj = Visio.Application.BuiltInMenus
' Insert new menu after Tools
Set menuObj = UIObj.MenuSets.ItemAtID(visUIObjSetDrawing).Menus.AddAt(7)
menuObj.Caption = "My Menu"
' Add item - Asset Properties
Set menuitemObj = menuObj.MenuItems.Add
With menuitemObj
.Caption = "Asset Properties..."
'.CmdNum = 0
.Enabled = True
.ActionText = "Display properties of the selected assets"
.AddOnName = "frmProperties.Display"
End With
' <snip - repeat several times, for each item>
' Now display the modified menu for this document...
ThisDocument.SetCustomMenus UIObj
'Instantiate the linked database
Set adbAssetDB = New AssetDB
End Sub
I know the code is being executed, becaus if I comment it out, the menu is
not added.
Thanks in Advance
Kevin