Application.SetCustomMenus Method
Visio Automation Reference |
Replaces the current built-in or custom menus of an application or document.
Version Information
Version Added: Visio 4.0
Syntax
expression.SetCustomMenus(MenusObject)
expression A variable that represents an Application object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
MenusObject | Required | [IVUIOBJECT] | An expression that returns a UIObject object that represents the new custom menus. |
Return Value
Nothing
Remarks
If the UIObject object was created in a separate process by using the CreateObject procedure instead of getting the appropriate property of an Application or Document object, the SetCustomMenus method returns an error.
Example
This Microsoft Visual Basic for Applications (VBA) macro shows how to add a menu and menu item to the drawing window menu set, and then replace the built-in menu set with the custom set.
To restore the Microsoft Office Visio built-in menus after you run this macro, call the ThisDocument.ClearCustomMenus method.
Visual Basic for Applications |
---|
|
See Also