• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Visio Guy

Smart graphics for visual people




  • Home
  • Hire Me
    • Hire Me
    • Résumé
  • Products
    • Products
    • Bubble Revision Shape
    • Layers to Pages Utility
    • Rack Unit Dimension Line
    • Radial Elements Tool with up to 100 Wedges
    • Text on a Circle Visio SmartShape
  • Index
    • Articles by Date
    • YouTube – VisioGuy
    • Download Information
    • Suggestion Box
    • Shop
    • Visio Art
    • Visio Links
    • – Visio Shapes & Stencils
    • – Visio Templates & Drawings
  • About
    • About
    • Donate
    • GitHub
    • jsFiddle
    • Reading List
    • Subscribe & Follow
      • – E-mail
      • – facebook
      • – Twitter
      • – RSS
    • Privacy Policy
  • Discussion Forum
You are here: Home / Development / Code / Customized Visio HTML Export

Customized Visio HTML Export

August 24, 2007 By Visio Guy 10 Comments

A recent Visio newsgroup post asked about customizing the output files from Visio’s Save As Web feature. This rang a bell in the ol’ noggin, and I went searching for an old demo that exported a customized html page, with pop-up menus that displayed Custom Property (Shape Data) information.

This demo doesn’t use Visio’s built-in Save As Web feature, but instead uses automation code in the form of VBA stored in the document. But before we talk about code, let’s explain how to use it. The imagined user-scenario goes like this:

The user wants to highlight various items in her Visio document, such that viewers of the exported web-page can mouse-over special regions and see a pop-up dialog that displays info about that region.

The way the document is built is as follows:

  1. The user places custom “Hot Spot” shapes on top of the regions of interest in the diagram
  2. She fills in some information about the region
  3. She right-clicks the Page and chooses “Export” from the menu
  4. A web-page is produced by the code, that displays pop-ups when the mouse is over the specified regions

Below, we can see the Hot Spot shape in action. We’ve imported an image of a snazzy, not-so-new BMW, and placed a Hot Spot shape over the passenger-side mirror. The Shape Data (Custom Properties) window shows us three fields that we can fill out: Number, Title and Notes.

Visio Hot Spot Shape

click to view larger image

Once all of the hot spot regions are defined and configured, we simply right-click a blank area on the page and choose “Export” from the menu:

Export Right-click Menu Item

The resulting web-page displays pop-ups when the user rolls the mouse over the previously specified regions. The Hot Spot shapes do not show in the html page, but the numbers do. In the screenshot below, the user has rolled over the license-plate hot spot:

The Final Output

Running the Demo

As we said before, the document uses VBA code to get the job done. It doesn’t use Visio’s Save As Web functionality at all, but makes use of Visio’s image exporting capabilities. It also does a bit of math to figure out where the mouse hit-zones are, replaces a few parameters in the otherwise-hard coded html, then spews out an html document. Go ahead and laugh at the html code while you’re perusing the VBA, I’m sure it’s quite poor.

Since the document uses VBA to get the job done, you’ll need to know how to deal with Visio’s macro security. While the document VBA Macro Security will tell you all you need to know, the correct thing to do is this:

  1. Disallow the macros when you first open the Visio document
  2. Open the VBA project, examine the code, check that nothing malicious or offensive is present (besides the ugly html code)
  3. Close the document
  4. Re-open, and allow and the macros to be enabled

After you’ve dodged the VBA security-bullets, you’ll hit another obstacle: Internet Explorer security. Since the document utilizes javaScript to produce the pop-ups, you’ll see this friendly message at the top of your IE browser window:

IE Security Warning

Click this little bugger and “Allow Blocked Content…” if you want to see the pop-ups in action. Note, if FireFox is your default browser, you might not see the pop-ups. They didn’t work for me in FireFox, but were just fine in IE.

Limitations of the Demo

The download has a few limitations…well it IS a demo after all…

  • The Visio diagram is exported as an single image
  • You can’t specify the resolution of this image via code
  • Hyperlinks in the diagram will not exist in the web-page, as with the normal Visio Save As Web feature
  • When you scroll the browser window, the pop-ups can get off-position with the mouse

Nevertheless, this thing might make a useful little tool for some of you out there. For the developers, well, um, I’m sure there are much better ways to code the html and pop-up features than are shown in this demo. But we think the concept is intriguing, and we hope that this will get your creative-visio-juices flowing as to what could be done with the Visio on the web!

Download “Customized Visio HTML Export”

s!Aj0wJuswNyXlhTKPjKCp8gDULL-1 – Downloaded 1525 times – 103.00 B
  • Tweet
  • More
  • Pocket
  • Share on Tumblr
  • Print
  • Email

Related posts:

  1. The Hidden World of Visio Shapes
  2. Text to the Bottom of the Shape
  3. Connect All Shapes to Each Other
  4. European Cup 2008 Auto-Updating Visio Diagram
  5. European Cup 2008 Auto-Updating Visio Diagram (v2)

Filed Under: Code, Development, Drawings & Templates Tagged With: Code, HTML, Programming, Right-Click Actions, Web

Previous Post: « Resize Text With Metafiles!
Next Post: Interesting Blog With Cool Visio Topics »

Reader Interactions

Comments

  1. Jacco says

    August 29, 2007 at 10:48 am

    Hi there,

    I have done something similar, to create an interactive version of the design documentation I create with Visio (screenflows, sitemaps & wireframes). I’m linking the screenflows to the wireframes by using a consistent numbering method, and create on-the-fly imagemaps for the wireframes themselves. It’s really helped to smooth the communication of these documents to the different audiences, as the whole thing becomes much more interactive.

    I’m happy to share more of this if you’re interested. The whole thing, which I have called swipr (Screenflows, Wireframes, Interactive PRototype), is available for download under the GPL, so you and everyone else is free to look at it and change it. Check it out at swipr.blogspot.com (the swipr site is down, sorry).

    If you’d like more information, please let me know. I’m eager to share!

    Jacco

  2. Lisa Wenzel says

    August 29, 2007 at 12:11 pm

    Hey Guy,

    this post is really cool. It´s an inspiration for more… I just search for a good possibility to comment my wireframes.

    But I´ve one question… I know it´s a little bit stupid, but I don´t know how you make the 3D effect from the red circles. I know how to fill it that way, but how can I move the centre from the white effect???

    Nice to hear from you
    Lisa

  3. Visio Guy says

    August 29, 2007 at 1:20 pm

    Servus Lisa,

    Don’t feel bad about those circles! It’s not easy to get the circular fill to be off-center, like you see in the images above, you have to do some tricks!

    I think we will write an article about “off-center radial fill patterns” very soon. You have to use the ShapeSheet a little bit in order to get it to work.

    – Chris

  4. Visio Guy says

    August 30, 2007 at 4:25 am

    Okay, here’s the article about the offset radial fill: http://www.visguy.com/2007/08/30/off-center-radial-fill-effect/

  5. Lisa Wenzel says

    August 31, 2007 at 7:15 am

    Thank you very much

    the descripiton is real strange – how do you find something out 😉

    Perhaps I can use it in my daily work,

    By Lisa

  6. wrg says

    September 11, 2007 at 12:36 pm

    this is really cool but when ever I try and export I get a system error.
    Thoughts?

  7. Visio Guy says

    September 12, 2007 at 3:21 am

    Hi Wrg,

    I think this is because you haven’t enabled the VBA macros. The diagram contains VBA code that makes the export happen. Visio has security measures that prevent macros from running without your permission, to protect you from wackos that might send you documents with deviant code (ie: Not Visio Guy stuff 😉 ) Read this post to find out more about macro security:

    VBA Macro Security

    We really need to get a Digital Certificate for the content we post on this site!

  8. Tricia says

    January 11, 2008 at 6:31 pm

    I have a different problem: I created some custom shapes using ShapeStudio but they are not exporting properly to HTML. Specifically, I’m able to create working hyperlinks for the custom shapes but the HTML pages created by the export contain empty image maps like this:

    This only happens with the custom shapes for which I defined right-click menu options. For these shapes, the user selects which of several images to display.

    I use Visio 2003 Professional. I can’t find anything on this topic anywhere.

    Thanks in advance!

  9. Lars Blixt says

    July 17, 2008 at 2:54 pm

    Excellent. Really nice I wonder why Microsoft does not have this function by default. Is it it easy to have more than three properies displayed in the pop-up? And is it possible to change the colour of the font and backgroudcoulor for the pop-up window?

  10. icouillard says

    July 28, 2015 at 4:24 pm

    I have tried this program but the pop-ups are not showing in internet explorer even if I “allow blocked contents”. Any idea?

Leave a Reply Cancel reply

Primary Sidebar

Buy Über Bubble Revision Shape
Purchase

Categories

Buy my book!

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tag Cloud

A/V Artistic Effects BPM Code Connectors Control Handles Countries Custom Patterns Custom Properties Data Graphics Data Linking Data Visualization David Edson David Parker Fill Format Formulas Functions Geometry Gradient Images Links Maps Multi-shapes Network Programming repeating shapes Resources Right-Click Actions Scale Shape Data ShapeSheet ShapeSheet Formulas ShapeSheet Functions SharePoint shiny SmartShapes Sport Sports Text Themes Tools Transparency User-defined Cells Visio 2007 Visio SmartShapes

Top Posts & Pages

  • - Visio Shapes & Stencils
  • - Visio Templates & Drawings
  • Amazon AWS Visio Shapes
  • Free Visio People Shapes
  • Sankey Diagram Shapes for Visio
  • Bubble Revision Shapes
  • Visio Network Server Shape Icon Customization Tool
  • AV Engineering Diagrams with Symbol Logic ECAV
  • Release the Power of Visio Custom Line Patterns
  • Crayon Visio Network Shapes, Revisited

www.visguy.com - Visio Guy - since 2006

 

Loading Comments...