MenuItems.AddAt Method
Visio Automation Reference |
Creates a new MenuItem object at a specified index in the MenuItems collection. .
Version Information
Version Added: Visio 4.0
Syntax
expression.AddAt(lIndex)
expression A variable that represents a MenuItems object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
lIndex | Required | Long | The index at which to add the object. |
Return Value
MenuItem
Remarks
If the index is zero (0), the object is added at the beginning of the collection.
The beginning of a MenuItems collection is the topmost menu item. For example, the New Window menu item is the first menu item in the MenuItems collection for the WindowMenu object.
Example
The following macro shows how to add a menu and menu item to the drawing window menu set. This macro uses the AddAt method to add a menu before the Microsoft Office Visio Window menu.
This example assumes that you already have a macro called "MyMacro" in the Microsoft Visual Basic for Applications (VBA) project associated with the active Visio document.
Visual Basic for Applications |
---|
|
See Also