MenuItem.AddOnArgs Property
Visio Automation Reference |
Gets or sets the argument string that you send to the add-on associated with a particular menu or toolbar. Read/write.
Version Information
Version Added: Visio 4.0
Syntax
expression.AddOnArgs
expression A variable that represents a MenuItem object.
Return Value
String
Remarks
An argument's string can be anything appropriate for the add-on. However, the arguments are packaged together with other information into a command string, which cannot exceed 127 characters. For best results, limit arguments to 50 characters.
An object's AddOnName property indicates the name of the add-on to which the arguments are sent.
Beginning with Visio 2002, the AddOnName property used in the following example cannot execute a string that contains arbitrary Microsoft Visual Basic code. To call code that in previous versions of Visio you would have passed to the AddOnName property, move it to a procedure in a document's Visual Basic project that is called from the AddOnName property, as shown in the following example.
Example
This Microsoft Visual Basic for Applications (VBA) macro shows how to set the AddOnArgs property of a menu item. It also shows how to add a menu and menu item to the drawing window menu set and how to set some of the menu item's other properties, such as Caption, AddOnName, and ActionText.
This example assumes that you already have a macro in the current Visual Basic project, and that that macro takes one argument called "Arg1". Before running this example, replace macroname with the name of your macro.
To restore the built-in menu set after running this macro, use the ThisDocument.ClearCustomMenus method.
Visual Basic for Applications |
---|
|
See Also