C
calvinX
Hi All,
I have a question, hopefully it is a simple one.
Ho do I call some metods in a class object that is in a VISIO 2002 add-in
that I am building (VS.NET). I am going to be adding a custom menu and
would like to know how I can reference these methods. When I had the code
stored in the document I used MODULE_NAME.FUNCTION_NAME.
Any help would be great, here is the code:
Private Sub AddDocumentMenu()
On Error Resume Next
'Attach new menu to Visio.
Dim uiObj As UIObject 'contains the UI object for this instance of Visio
Dim MenuSetsObj As MenuSets 'MenuSets collection
Dim MenuSetObj As MenuSet 'A MenuSet object
Dim MenusObj As Menus 'Menus collection
Dim MenuObj As Menu 'A Menu object
Dim MenuItemsObj As MenuItems 'MenuItems collection
Dim MenuItemObj As MenuItem 'A MenuItem object
Dim strMenuAction As String
uiObj = AppVisio.BuiltInMenus
MenuSetsObj = uiObj.MenuSets
MenuSetObj = MenuSetsObj.ItemAtID(visUIObjSetDrawing)
'Put a single menu into this set
MenusObj = MenuSetObj.Menus
MenuObj = MenusObj.AddAt(6)
MenuObj.Caption = "&Draw Actions"
MenuItemsObj = MenuObj.MenuItems
MenuItemObj = MenuItemsObj.Add
MenuItemObj.Caption = "Point &List Fill"
strMenuAction = "Custom_Functions.ListFill"
MenuItemObj.AddOnName = strMenuAction
MenuItemObj.MiniHelp = "Fill selected points list"
MenuItemObj.ActionText = "Fill selected points list"
'<<<<<<<<<SEPERATOR
MenuItemObj = MenuItemsObj.Add
MenuItemObj.CmdNum = 0
'<<<<<<<<<VERIFY LAYERS
MenuItemsObj = MenuObj.MenuItems
MenuItemObj = MenuItemsObj.Add
MenuItemObj.Caption = "&Verify Document Layers"
strMenuAction = "Custom_Functions.VerifyPageLayers"
MenuItemObj.AddOnName = strMenuAction
MenuItemObj.MiniHelp = "Verify correct layers are present on each page"
MenuItemObj.ActionText = "Verify correct layers are present on each page"
' Change the current menus to the custom one
AppVisio.SetCustomMenus(uiObj)
End Sub
I have a question, hopefully it is a simple one.
Ho do I call some metods in a class object that is in a VISIO 2002 add-in
that I am building (VS.NET). I am going to be adding a custom menu and
would like to know how I can reference these methods. When I had the code
stored in the document I used MODULE_NAME.FUNCTION_NAME.
Any help would be great, here is the code:
Private Sub AddDocumentMenu()
On Error Resume Next
'Attach new menu to Visio.
Dim uiObj As UIObject 'contains the UI object for this instance of Visio
Dim MenuSetsObj As MenuSets 'MenuSets collection
Dim MenuSetObj As MenuSet 'A MenuSet object
Dim MenusObj As Menus 'Menus collection
Dim MenuObj As Menu 'A Menu object
Dim MenuItemsObj As MenuItems 'MenuItems collection
Dim MenuItemObj As MenuItem 'A MenuItem object
Dim strMenuAction As String
uiObj = AppVisio.BuiltInMenus
MenuSetsObj = uiObj.MenuSets
MenuSetObj = MenuSetsObj.ItemAtID(visUIObjSetDrawing)
'Put a single menu into this set
MenusObj = MenuSetObj.Menus
MenuObj = MenusObj.AddAt(6)
MenuObj.Caption = "&Draw Actions"
MenuItemsObj = MenuObj.MenuItems
MenuItemObj = MenuItemsObj.Add
MenuItemObj.Caption = "Point &List Fill"
strMenuAction = "Custom_Functions.ListFill"
MenuItemObj.AddOnName = strMenuAction
MenuItemObj.MiniHelp = "Fill selected points list"
MenuItemObj.ActionText = "Fill selected points list"
'<<<<<<<<<SEPERATOR
MenuItemObj = MenuItemsObj.Add
MenuItemObj.CmdNum = 0
'<<<<<<<<<VERIFY LAYERS
MenuItemsObj = MenuObj.MenuItems
MenuItemObj = MenuItemsObj.Add
MenuItemObj.Caption = "&Verify Document Layers"
strMenuAction = "Custom_Functions.VerifyPageLayers"
MenuItemObj.AddOnName = strMenuAction
MenuItemObj.MiniHelp = "Verify correct layers are present on each page"
MenuItemObj.ActionText = "Verify correct layers are present on each page"
' Change the current menus to the custom one
AppVisio.SetCustomMenus(uiObj)
End Sub