Share via


Visio Solutions

Visual Studio 2010 provides project templates you can use to create application-level add-ins for Microsoft Office Visio. You can use add-ins to automate Visio, extend Visio features, or customize the Visio user interface (UI).

For more information about application-level add-ins, see Getting Started Programming Application-Level Add-Ins and Architecture of Application-Level Add-Ins. If you are new to programming with Microsoft Office, see Getting Started (Office Development in Visual Studio).

Applies to: The information in this topic applies to application-level projects for Visio 2007 and Visio 2010. For more information, see Features Available by Office Application and Project Type.

Automating Visio by Using the Visio Object Model

The Visio object model exposes many classes that you can use to automate Visio to create diagrams for organizational charts, flowcharts, project timelines, network diagrams, office spaces, and more. The API enables you to write code to accomplish common tasks:

  • Construct and position shapes and text in diagrams.

  • Manage shape behavior based on business logic and user input.

  • Control diagram visualization such as panning and zooming.

  • Customize the application UI.

  • Import external data into Visio, link it to shapes, and display it graphically on a page.

You can view step-by-step procedures and code examples for using the object model of Visio to work with documents and shapes in Working with Visio Documents and Working with Visio Shapes.

To access the Visio object model from an add-in, use the Application field of the ThisAddIn class in your project. The Application field returns a Microsoft.Office.Interop.Visio.Application object that represents the current instance of Visio. For more information, see Programming Application-Level Add-Ins.

When you call into the Visio object model, you use types that are provided in the primary interop assembly for Visio. The primary interop assembly acts as a bridge between the managed code in the add-in and the COM object model in Visio. All types in the Visio primary interop assembly are defined in the Microsoft.Office.Interop.Visio namespace. For more information about primary interop assemblies, see Office Solutions Development Overview and Office Primary Interop Assemblies.

Visio Object Model Overview

You can find an overview of the Visio object model at Visio Object Model Overview, which includes links to the Visio object model reference and the SDKs.

Customizing the User Interface of Visio

The Visio UI has the following customization options.

Task

For more information

Add custom toolbars and toolbar items.

How to: Create Office Toolbars

Add menus and menu items.

How to: Add Commands to Shortcut Menus in Excel

For information about customizing the UI of Visio, see the VBA reference documentation for the Visio.UIObject class.

See Also

Tasks

How to: Create Office Projects in Visual Studio

Reference

Office Primary Interop Assemblies

Concepts

Getting Started Programming Application-Level Add-Ins

Office Solutions Development Overview

Architecture of Application-Level Add-Ins

Writing Code in Office Solutions

Visio Object Model Overview

Other Resources

Programming Application-Level Add-Ins

Office UI Customization

Visio 2010 in Office Development