Controlling the Visio HTML Wizard AddOn via Automation
Home Visio  This page


Via the SaveAs dialog, Visio 2000 includes the ability to render a page or series of pages in a plausible HTML format. This generates a series of HTML pages with the Visio drawings embedded as GIFs, and optionally in VML ("Vector Markup Language").

Numerous developers have naturally wanted to invoke this functionality from Automation so that their users don't have to operate that functionality.  However, it is built as a separate wizard, and though that wizard is implemented in a DLL (VISHTMLO.dll), and contains a Type Library (VISHTML6), it is not documented by Visio/Microsoft.

Herewith, then, a stab at documentation for this wizard's Automation interface. Much of the credit for the footwork should go to Kevin Wyatt of Viswest Integrated Solutions in Australia, who in turn credits some of this to a nameless developer at Visio who long ago  "leaked" some of the Visio 5 HTML version's secrets.

Digging In

The VISHTML6 library defines a number of objects that must be created and built into a structure in order to specify and then run the HTML export. Indeed, the length that you have to go to seems rather excessive considering the simplicity of the result. Doubtless there was a grand scheme behind this wizard, but it apparently didn't reach full fruition before shipping. Consequently, there's probably even more functionality that you can wring out of the mechanism, if you care to explore farther than this discussion here. But for now, on with the explanation of how to at least make the darn thing happy enough to be cooperative.

Because of the moderate complexity, I've created a diagram showing all the objects, their relationships and their properties and methods. The diagram is difficult to present on a webpage (HTML wizard not withstanding!), so I've packaged the diagram with a demo vsd, and I highly recommend downloading and printing the diagram before proceeding.

Download Demo Code and Object Diagram.

The Basic Plot

Once you have the diagram and demo code the following explanation will make some sense. The basic plan works like this:

You can see in the object diagram the kinds of properties you can set at each level, and the demo code demonstrates setting a few of those properties.

Demo Code Notes

External Apparatus

There are several elements of the apparatus not shown in the object diagram. These include:

Some Notes On Properties and Methods

There are a number of properties and methods not exercised by the demo code. Here are some additional notes on a few of them:

Object Property or Method Discussion
Utilities LoadThemes This is the key method used to create and initialize the Themes structure. See sample code.
CreateDefaultTheme("c:\Temp") Can be used to recreate the Default theme's template files.
DefaultThemeName Returns "Default". May differ in other languages?
IsThemeRegistered Seems to always return True regardless of whether named theme exists.
IsDefaultThemeRegistered Seems to always return False.
This appears to be a vestige left over from Visio 5 as it saves an HTML file which refers to Visio 5 and is unlike any produced by wizard in Default template files.
ExportData VMLFilter If you assign a filter (presumably the VML filter) to this property, then the wizard will produce VML output. If you don't want VML output, do not assign a filter to this property.
  MapType 1 = client side, 2 = server side
Filters Parent Set Filters.Parent = Application
...will cause the wizard to find all of the available filters and add them to the Filters collection.
Exports (ie: the ExportPages collection) The wizard fills this in during the ExportMgrDrawing.Export function. Your code can then use this collection to find and work on the files some more if it needs to.

Sample Registry Settings

This is simply a printout of the registry settings pertaining to the HTML wizard as installed by default.

[HKEY_CURRENT_USER\Software\Visio\Solution\Save As HTML]
    Base Name=TwoBoxes4.htm
    VML Alternate Filter=GIF
    VML Use Alternate=01,00,00,00
    Horizontal DPI=60,00,00,00
    Vertical DPI=60,00,00,00
    Screen Width=80,02,00,00
    Screen Height=e0,01,00,00
    JPEG Quality=64,00,00,00
    Enable Image Mapping=01,00,00,00
    Image Mapping Type=01,00,00,00
    CGI Image Map=
      [Document Substitutions]
        BASE_TARGET=<base target="_top">
      [Page Substitutions]


Article Created: 2000-08-14  Last edit: Last edit: 00-10-30 Graham Wideman
Go to: