Creating a SubMenu

G

Gerald K

I can't work out how to create a submenu.
I can create a new menuset, and I can add menuitems to it, but how do I add
a 'submenu' (which itself will have a collection of menuitems) to the menuset?

The code and declarations look like:

Dim AUIObject As Visio.UIObject
Dim AMenuset As Visio.MenuSet
Dim AMenu As Visio.Menu
Dim AMenuItem As Visio.MenuItem

Set AMenuset = AUIObject.MenuSets.ItemAtID(visUIObjSetDrawing)
Set AMenu = AMenuset.Menus.Add
AMenu.Caption = "MyNewMenu"

Set AMenuItem = AMenu.MenuItems.Add
AMenuItem.Caption = "MyNewMenuItem"
AMenuItem.AddOnName = "ThisDocument.Test"
 
G

Gerald K

Actually, I worked it out:

Set ASubMenuItem = AMenuItem
' set ASubMenuItem to the current menu item

Set AMenuItem = ASubMenuItem.MenuItems.Add
 

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