Visio and Xml Conference Resources
Back in January 2006, I made a presentation at the Microsoft Office Visio Conference in Home-Sweet-Home Seattle. Good company, good information, and good fun was had by all! You can download plenty of excellent content from that conference, including PowerPoint slides and recorded presentations. Get it here: Visio Conference web site.
In my presentation, Working With Visio an Xml, our friend, Dr. Xml, proudly made his PowerPoint debut and won the crowd over. The presentation summary was…
Enhance the flexibility of your Visio solutions with XML. In this session you will learn how to use the Visio XML file format, how to store custom XML data islands in SolutionXML, and how to stream Shape XML elements to your drawings using the DataObject.
You can find my presentation’s materials on the Visio Conference web site page (just search the text for Chris Roth), or directly download the materials here:
I don’t think that the Microsoft downloads contain all the source code and demo files. You can download them here: (Download VisioXmlPresentation.zip 1.3MB)

You’re a/v download link seems to be broken. Just thought I’d let you know.
Thank MattJ,
No idea what went wrong, but it’s fixed now!
Chris,
I have built (and modified … converted to c#,etc) your sample code that uses a XML drawing and adds shapes and connectors to create a drawing using XML… very cool… only example of this I have seen anywhere… Thanks! I have the same issue you left in the example… Visio does not “layout” the connectors until I move a shape or use a “layout command”. Did you find a way to get Visio to layout the connectors when it opens the drawing?
thanks,
Chris M
[...] from the last Visio conference available for download, including the Visio Guy’s Visio-XML show (see: Visio and Xml Conference Resources) So even without the new stuff, there’s still lots of goodies from the last [...]
Hello,
I’m trying to create a XML-drawing and everything seems to work fine, only the connectors are not displayed until you move one or more shapes. This is the same problem that Chris Maloney encounters and I was wondering if you already know of a solution. I do not use automation (XML-code is created from within a SQL Server DTS-package).
Thanks,
Martin Thiele
Hi Martin,
I actually had this problem when I gave the presentation a few years ago, and still haven’t had the time to figure it out.
I’ll ask around, see if any of the other Visio Geeks have figured it out. Kind of kills the whole “server-side document generation” thing, doesn’t it?
I found this post on Mai-Lan’s blog:
http://blogs.msdn.com/mailant/archive/2004/10/26/248369.aspx
It’s from 2004, so maybe they’ve changed something, but it recommends calling Layout on Open. Duh. Still not a solution, but maybe an answer…
Thanks for your quick reply! For the moment we’ve solved it by opening the diagram and flipping/unflipping each shape. This way the layout doesn’t change but it’s a fairly slow. Hope that we will find another solution in the near future.
Hi Martin,
Have tried flipping/unflipping the whole drawing (page)?
This little sub might do the trick a bit faster for you.
Since those unrouted connectors are in the lower-left corner of your page, this code first draws a really long diagonal line from ( -pagewidth, -pageheight ) to ( 2 * pagewidth, 2* pageheight ) so that all objects on the page will be symmetrically encompassed by ’select all’. That way, when we do flip-x twice, the objects on the page won’t move.
At any rate, this should work faster than flipping each individual shape…
Sub FlipXmlPage()
‘// Get the page and the size of the page:
Dim pg As Visio.Page
Dim pw As Double, ph As Double
Set pg = Visio.ActivePage
pw = pg.PageSheet.Cells(”Width”).ResultIU
ph = pg.PageSheet.Cells(”Height”).ResultIU
‘// Draw a big diagonal line to make all objects
‘// on the page symmetrical:
Dim shpLine As Visio.Shape
Set shpLine = pg.DrawLine(-pw, -ph, 2 * pw, 2 * ph)
‘// Flip everything on the page
Dim sel As Visio.Selection
Set sel = Visio.ActivePage.CreateSelection(Visio.VisSelectionTypes.visSelTypeAll)
sel.Flip (Visio.VisFlipDirection.visFlipHorizontal)
sel.Flip (Visio.VisFlipDirection.visFlipHorizontal)
‘// Get rid of the line:
shpLine.Delete
End Sub
Spending money on investing video conferencing system has saved me time and money by optimizing my business through video conferencing.