Dela via


Visio Solutions

Applies to

The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.

Project type

  • Application-level projects

Microsoft Office version

  • Visio 2003

  • Visio 2007

For more information, see Features Available by Application and Project Type.

Visual Studio Tools for Office 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 (Visual Studio Tools for Office).

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 Microsoft Office Visio to work with documents and shapes in Visual Studio Tools for Office projects in Working with Visio Documents and Working with Visio Shapes.

To access the Visio object model from a Visual Studio Tools for Office 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 Visual Studio Tools for Office 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 Programmatically

Add menus and menu items.

How to: Create Office Menus Programmatically

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

See Also

Tasks

How to: Create Visual Studio Tools for Office Projects

Concepts

Getting Started Programming Application-Level Add-Ins

Office Solutions Development Overview

Architecture of Application-Level Add-Ins

Programming Application-Level Add-Ins

Writing Code in Office Solutions

Office UI Customization

Visio Object Model Overview

Reference

Office Primary Interop Assemblies