Menu.AddOnName property (Visio)

Gets or sets the name of an add-on or procedure that is run when its associated menu is selected. Read/write.

Syntax

expression.AddOnName

expression A variable that represents a Menu object.

Return value

String

Remarks

Note

Starting with Visio 2010, the Microsoft Office Fluent user interface (UI) replaced the previous system of layered menus, toolbars, and task panes. VBA objects and members that you used to customize the user interface in previous versions of Visio are still available in Visio, but they function differently.

Assuming that the name of the add-on in the Addons collection is string , if the project of the currently active document (or another project if it is referenced) does not have a procedure named string , or if the arguments passed in string don't match those specified in the procedure, Microsoft Visio runs the add-on named string. If no add-on named string can be found, Visio does nothing and reports no error. (Use the TraceFlags property to monitor the procedures and add-ons that Visio attempts to run.)

If string is an add-on, use the AddOnArgs property to specify arguments to send to the add-on when it is run.

If string is a procedure, specify arguments using procname(arguments) or procname arguments.

When calling a procedure in a standard module it is recommended that you prefix the string with the module name that contains the procedure (for example, moduleName.procName ) because more than one module can have a procedure with the same name.

To call a procedure in a project other than the project of the active document, use the syntax projName.modName.procName (you must have explicitly set a reference to projName in your Visual Basic project).

If the AddOnName property is set, Visio ignores the object's CmdNum property.

Note

Beginning with Visio 2002, the AddOnName property cannot execute a string that contains arbitrary VBA code. To call code that in previous versions of Visio you would have passed to the AddOnName property, move the code to a procedure in a document's VBA project that is called from the AddOnName property.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.