Viewer object (Visio Viewer)

The Viewer object is a programmable ActiveX control that enables you to display Visio drawings (with limited functionality) on webpages and in Windows Forms, so that users who don't have Visio installed on their computers can view and interact with them.

Remarks

With Visio Viewer, users can open, view, or print Visio drawings, even if they don't have Microsoft Visio installed. They cannot, however, edit or save drawings, or create a new Visio drawing. For that, they need to install Visio.

The Viewer object is the entry point to the Viewer object model, and represents an instance of the Viewer control. The properties, events, and methods available in the Viewer object model let you load and unload Visio drawings in Visio Viewer, temporarily change properties and settings of the drawing, react to user input, and customize the Visio Viewer environment. In many cases, these members correspond to the options available to users in the Visio Viewer user interface (UI).

The following is a partial listing of the members of the Viewer object and their functions and provides a sampling of the programming options available to developers. For code samples that show how to get an instance of the Viewer object in the available development environments, see About Programming Visio Viewer.

Use the Load method to load a Visio drawing into Visio Viewer, and use the Unload method to unload the drawing. You can also use the Src property to get and set the file name and path for the current drawing.

Use the DisplayAbout, DisplayContextMenu, DisplayHelp, and DisplayPropertyDialog methods to display the dialog boxes and shortcut menus available in the Visio Viewer UI.

Use the SelectShape method to select a particular shape in the drawing, and use the ShapeName and ShapeCount properties to get information about shapes in the drawing.

Use properties such as BackColor, GridVisible, LayerColor, PageColor, ScrollbarsVisible, and ToolbarVisible to customize the appearance of the Visio Viewer UI.

Use the CustomPropertyCount, CustomPropertyName, and CustomPropertyValue properties to determine shape data (custom properties).

Use events such as OnLayerChanged and OnSelectionChanged to respond to user input.

Events

Methods

Properties

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.