About extending the functionality of Microsoft Visio

Microsoft Visio Developer Reference

About extending the functionality of Microsoft Visio

You can extend the functionality of Microsoft Visio in the following ways:

  • Create Visio-specific macros and add-ons.
  • Create COM (Component Object Model) add-ins.

Click to show or hide information.Macros and add-ons

Macros and add-ons are programs that extend the functionality of Microsoft Visio. Exactly how you run a macro or add-on depends on the context for which it was designed.

You can run a macro or add-on from the Visio application in several ways. Here are a few of the most common:

  • Choose a macro or add-on from the Macros dialog box (on the Tools menu, point to Macros, and then click Macros). If your program is an EXE file, before it can appear in the Macros dialog box it must be located in a folder along the Visio Add-ons path on the File Paths tab in the Options dialog box (on the Tools menu, click Options).
  • Double-click a shape associated with an add-on or macro. The program you want to run must be selected in the Run macro list on the Double-Click tab in the Behavior dialog box for that shape (on the Format menu, click Behavior).
  • Right-click a shape, and then click a custom menu item for an add-on or macro on the shortcut menu. The program associated with the custom menu item must be entered in the Actions section of the ShapeSheet window for the shape.

If an add-on is designed to be run outside of the Visio application, you run it like any Microsoft Windows–based program (for example, by double-clicking an icon on the desktop). For details, see your Windows documentation.

Click to show or hide information.COM add-ins

Beginning with Microsoft Visio 2002, you can use COM add-ins in the same standardized way as other Microsoft Office applications. The COM add-in must be registered with the Visio application and can work in multiple applications. For example, you can build a COM add-in that performs the same task in Visio and Microsoft Excel, or any of the Microsoft Office applications. COM add-ins can be created with Microsoft Visual Basic 5.0 and higher, Microsoft C++, Microsoft Office 2000 Developer Edition and higher, or any of the Microsoft Visual Studio.NET applications.

For more information about building COM add-ins, see the Microsoft Developer Network (MSDN) Web site.