Visio 2002 Technical Articles
Embed a Microsoft Visio Viewer 2002 Control in a Web Page
 

Microsoft Corporation

September 2002

Applies to:
    Microsoft Visio Viewer 2002
    Microsoft Visio 2002
    Microsoft Visio 2000
    Microsoft Visio 5.0

Summary:   Share Microsoft Visio 2002, 2000, and 5.0 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 Visio Viewer 2002.


Contents

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

Overview

With Microsoft® Visio® Viewer 2002, you can use Microsoft Internet Explorer 5.0 or later to view, print, and share drawings created in Visio and 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 more information, see Embed a Visio Viewer 2003 Control in a Web Page

For example, you can:

  • Send a Visio drawing as an e-mail attachment, and the recipients can open, view, and print the drawing using the Visio Viewer.
  • Post Visio drawings on an intranet site, and anyone can view and print the drawings with the 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 covers the third example: incorporating a Visio drawing into a Web page in its native Visio file format. With the 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.

For more information about using the Visio Viewer:

  1. Install the Visio Viewer first.
  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 2002 works on a variety of operating systems and supports two Visio file types, but also has several limitations. For example, the 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 the Visio Viewer:

  • Visio drawing format (.vsd) saved using Visio 5.0, 2000, or 2002.
  • Visio XML drawing format (.vdx) saved using Visio 2002.
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.
Important   Drawings created in Visio 2003 cannot be viewed with Visio Viewer 2002. To view Visio 2003 drawings, you must use Visio Viewer 2003. For more information, see Embed a Visio Viewer 2003 Control in a Web Page

Operating systems

The Visio Viewer 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)

Limitations

The 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.

Embed a Visio Viewer Control in a Web Page

With Visio Viewer 2002, 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.

The 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"
codebase="http://download.microsoft.com/download/visiostandard2002/
vview10/1/w982kmexp/en-us/vviewer.exe" id="viewer1" width="100%"
height="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">
</object>
Note   This code will not work with previous versions of the Viewer; you must have the Visio Viewer 2002 installed.

Parameter descriptions

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

Table 1. Parameter descriptions

ParameterDescription
AlertsEnabledEnables warning or alert dialog boxes to show when an error occurs.
BackColorSets the background color for the control. Specify an integer value.
ContextMenuEnabledEnables the context menu to show on right-mouse events.
CurrentPageIndexSpecifies 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.

CxSets the X location in the container (for example, Web page; some containers ignore this).
CySets the Y location in the container (some containers ignore this).
GridVisibleDisplays the grid if the drawing page is visible.
HighQualityRenderToggles high-quality rendering.
PageColorSets the drawing page color. Specify an integer value.
PageVisibleDisplays the drawing page.
PropertyDialogEnabledEnables the Properties & Settings dialog box to show on selection or toolbar events.
ScrollbarsVisibleDisplays the scroll bars.
SRCSpecifies the Visio drawing to open. Specify the drawing path by using a Web address.
ToolbarVisibleDisplays the toolbar.
ZoomSets 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 are using FrontPage 2002 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 Web Component. Or, on the toolbar, click the Web Component button.
  3. In the Insert Web Component dialog box, under Component type, click Advanced Controls.
  4. Under Choose a control, click ActiveX Control, and then click Next.
  5. Do one of the following:
    • In the Insert Web Component dialog box, under Choose a control, click Microsoft Visio Viewer, and then click Finish.

    Or

    • 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 Choose a 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 2002 describes the following deployment scenarios:

  • Deploying the Visio Viewer from an administrative installation point.
  • Assigning or publishing the Visio Viewer using Active Directory®.
Page view tracker