Share via

Embed a Visio Viewer 2003 Control in a Web Page


Microsoft Corporation

September 2004

Applies to:
    Microsoft Office Visio 2003

Summary:   Share Microsoft Visio drawings by embedding a Visio Viewer control in a Web page and using Microsoft Internet Explorer to view, print, and share these drawings. (6 printed pages)

Download Microsoft Office Visio Viewer 2003.


Requirements and Limitations
Embedding a Visio Viewer Control in a Web Page
Additional Resources


With Microsoft Office Visio Viewer 2003, you can use Microsoft Internet Explorer 5.0 or later to view, print, and share drawings created in Microsoft Office Visio 2003 or earlier versions that are saved in the native Visio file format (.vsd or .vdx)—even if you and your team members don't have Visio installed on your computers.

Important   If you are using Visio Viewer 2002, you cannot view drawings created in Visio 2003, although you can view drawings created in Visio 2002 or earlier versions. To view Visio 2003 drawings, you must use Visio Viewer 2003.

For example, with Visio Viewer you can

  • Send a Visio drawing as an e-mail attachment, and the recipients can open, view, and print the drawing using Visio Viewer
  • Post Visio drawings on an intranet site, and anyone can view and print the drawings with Visio Viewer
  • Incorporate Visio drawings into a Web page in their native Visio file format, which allows your audience to view custom properties saved with shapes

This article addresses the third example: incorporating a Visio drawing into a Web page in its native Visio file format. With Visio Viewer, you can embed a Visio Viewer control in a Web page, and then specify object parameters, such as the drawing you want to display and the color of the background.

Note   You can also share Visio drawings by saving them in popular graphic formats, such as GIF or JPG; however, the native Visio file format is a higher-quality graphic format. Using the Visio Viewer with the native format allows your audience to view custom properties saved with shapes, something they couldn't do otherwise.

To obtain more information about using Visio Viewer

  1. Install Visio Viewer.
  2. On your Web browser's File menu, click Open, and then open a Visio drawing.
  3. Right-click on the drawing page, and then click Help to view the online Help.
  4. In the contents pane, select the topic "Use Microsoft Visio and Microsoft Visio Viewer on the Same Computer."

Requirements and Limitations

Visio Viewer works on a variety of operating systems and supports two Visio file types, but it also has several limitations. For example, Visio Viewer doesn't display Visio stencils, rulers, guides, and guide points because these elements aren't necessary in a view-only mode.

Visio file types

You can open the following Visio file types with Visio Viewer 2003:

  • Visio drawing format (.vsd) saved using Visio 5.0, 2000, 2002, or 2003.
  • Visio XML drawing format (.vdx) saved using Visio 2002 or 2003.

**Note   **The Visio Viewer can display embedded DWG or DXF CAD drawings included in Visio drawings. However, it can't display embedded DGN CAD drawings.

Operating systems

Visio Viewer 2003 works on the following operating systems:

  • Microsoft Windows XP
  • Windows 2000 (Service Pack 2)
  • Windows Millennium Edition
  • Windows 98 Second Edition
  • Windows NT 4.0 (Service Pack 6 or later)


Visio Viewer doesn't support the following features:

  • Rotated pages (pages are shown without rotation)
  • More than one hyperlink included with a shape (the default hyperlink is used)
  • Hyperlinks included with the drawing page
  • Drawing page properties

**Note   **Custom fill styles, line styles, and some line ends in Visio drawings may not look the same in the Visio Viewer as they do in Visio.

Embedding a Visio Viewer Control in a Web Page

With Visio Viewer, you can embed a Visio Viewer control in a Web page by manually inserting the tags and parameters in the Web page's source code or, in some cases, by inserting it through your application's user interface, as you can with Microsoft FrontPage. Using either method, you embed a Visio Viewer control the same way you embed any other control.

Visio Viewer includes the sample file Sample.htm, which is a Web page with an embedded Visio Viewer control and a reference to a Visio drawing. Sample.htm is located in the Visio Viewer folder (drive:\\Program Files\Microsoft Office\Visio Viewer). The following block of source code shows how to insert a Visio Viewer control and set parameters manually:

To install the Visio Viewer automatically when a user views your 
Web page, you can set the value of the codebase attribute to 
a download location as shown in this example:
<object classid="clsid:279D6C9A-652E-4833-BEFC-312CA8887857"
vview10/1/w982kmexp/en-us/vviewer.exe" id="viewer1" width="100%"

<object classid="clsid:279D6C9A-652E-4833-BEFC-312CA8887857" 
id="Viewer1" width="792" height="524">
<param name="BackColor" value="16777120">
<param name="AlertsEnabled" value="1">
<param name="ContextMenuEnabled" value="1">
<param name="GridVisible" value="1">
<param name="HighQualityRender" value="1">
<param name="PageColor" value="16777215">
<param name="PageVisible" value="1">
<param name="PropertyDialogEnabled" value="1">
<param name="ScrollbarsVisible" value="1">
<param name="ToolbarVisible" value="1">
<param name="SRC" value="sample1.vdx">
<param name="CurrentPageIndex" value="1">
<param name="Zoom" value="-1">

Note   You must have Visio Viewer 2002 or 2003 installed to use this code.

Parameter descriptions

Table 1 includes all of the parameters you can set for a Visio Viewer control and a description of each parameter.

Table 1. Parameter descriptions

Parameter Description
AlertsEnabled Enables warning or alert dialog boxes to show when an error occurs.
BackColor Sets the background color for the control. Specify an integer value.
ContextMenuEnabled Enables the context menu to show on right-mouse events.
CurrentPageIndex Specifies the page displayed when the Visio Viewer opens the drawing.

Use the index of the page you want to display (for example, 1 for Page-1, 2 for Page-2, and so on). If you don't specify a page index or you set the value to 0, the Visio Viewer displays the page that was showing the last time you saved the drawing.

Cx Sets the X location in the container (for example, Web page; some containers ignore this).
Cy Sets the Y location in the container (some containers ignore this).
GridVisible Displays the grid if the drawing page is visible.
HighQualityRender Toggles high-quality rendering.
PageColor Sets the drawing page color. Specify an integer value.
PageVisible Displays the drawing page.
PropertyDialogEnabled Enables the Properties & Settings dialog box to show on selection or toolbar events.
ScrollbarsVisible Displays the scroll bars.
SRC Specifies the Visio drawing to open. Specify the drawing path by using a Web address.
ToolbarVisible Displays the toolbar.
Zoom Sets the initial zoom value.

You can specify a zoom percentage as a fraction (for example, 0.5 for 50% and 1.0 for 100%) or use any of the following values:

-1 = Whole page view

-2 = Page width view

-3 = Last zoom percentage

If you're using FrontPage 2002 or 2003 or to author your HTML, you can use the following procedure to insert a Visio Viewer control and set parameters through the user interface.

To insert a Visio Viewer control in a Web page and set parameters using FrontPage

  1. Start FrontPage and open a Web page.

  2. On the Insert menu, click WebComponent. Or, on the toolbar, click the Web Component button.

  3. In the Insert Web Component dialog box, under Component type, click AdvancedControls.

  4. Under Choosea control, click ActiveXControl, and then click Next.

  5. Do one of the following:

    • In the Insert Web Component dialog box, under Choosea control, click Microsoft Visio Viewer, and then click Finish.


    • If the Microsoft Visio Viewer control doesn't appear in the Choose a control list, click Customize.
    • In the Customize ActiveX Control List dialog box, under Control, select the Microsoft Visio Viewer check box, and then click OK.
    • In the Insert Web Component dialog box, under Choosea control, click Microsoft Visio Viewer, and then click Finish.
  6. Right-click the Visio Viewer control on the page, and then click ActiveX Control Properties.

  7. In the ActiveX Control Properties dialog box, click the Parameters tab, select an attribute, and then click Modify.

  8. Set the attribute values you want, and then click OK. Your Web page displays the Visio Viewer control with the parameters you specified.

Additional Resources

The Microsoft TechNet article Deploy Microsoft Visio Viewer 2003 provides information about deploying Visio Viewer 2003, using the following deployment scenarios:

  • Deploying the Visio Viewer from an administrative installation point.
  • Assigning or publishing the Visio Viewer using Microsoft Active Directory directory service.