I have been creating Microsoft Visio solutions for 30 years now … my first was in 1996! I have been an advocate for custom Masters from the very start, every since I learnt how editing the Master can automatically update all of its instance shapes can be automatically updated throughout the document. Whenever you drag and drop a Master from a Stencil into a document for the first time, it copies that Master to the Document Stencil, and from then on it will use the local Master in the Document Stencil to create new shape instances that reference the local Master. If you need to customise the local Master, then you should ensure that the Match master by name on drop is checked. All of the provided stencils contain Masters where this property is not checked. The main exception to this is the Dynamic connector Master. Not only is this Master provided with this property checked, it is also automatically created when you do certain actions. This article explains when this is done in the UI and in code.
[Read more…] about Creating a Dynamic connector master automaticallyCoding
How SVG in Visio can cause a Shape.BoundingBox(…) error
I have used Visio’s Shape.BoundingBox(…) for many, many years and I cannot ever recall it failing, but I have now managed to create some shapes that cause it to error. This caused many hours of confusion, so I nearly abandoned using the method, until I discussed it with my fellow Visio MVP, John Goldsmith (see VisualSignals), and together we examined the cause. It came down to a badly formed sub-shape within the shape that had zero dimension … and in fact had an incomplete ShapeSheet. If you look at the screenshot below, then you may notice that there is no Shape Transform section! That is a mandatory section, and should always exist … so how did this happen?

Post-Processing Paste from Clipboard in Visio
One of my current Visio VSTO add-in projects requires me to react to users pasting custom shapes in the Visio page from the clipboard. The process involves registering the ExitScope event and then checking the Clipboard contents. Initially, I was merely testing for a line in the DataObject that started with the word “Visio “, but then testing revealed that copying and pasting text from one shape to another was also getting processed, so then I added a further check that the line also finished with the word ” Shapes”. This works fine, but then I got to wonder if I could also post-process tables copied and pasted from Excel because the standard paste maintains font settings but omits the tabs and line feeds, making the text unusable without serious manual editing. This article explains how this can done.

Optimize Visio Flowcharts: Swimlane Reordering Tips
Microsoft Visio desktop Plan 2 and Professional editions provides the ability to create and synchronize cross-functional flowcharts between the diagram and an Excel table. This is great, and widely used for many types of processes. The Excel table normally has a Function / Swimlane column that contains text that becomes labels on the swimlane containers, and a Phase / Timeline column that contains text that becomes the label of the phase or separator containers. The import provides the option to order the diagram by Function and/or Phase, but it is impossible to get them ordered by both! This article provides a solution using a free macro-enabled Visio stencil.
[Read more…] about Optimize Visio Flowcharts: Swimlane Reordering TipsRefreshing the cached installed files of Visio
I have created many Visio solutions over the past 25 years and used a number of methods of creating an installation that includes Visio templates and stencils. I have just wasted many hours trying to debug an installation created with Advanced Installer until I realised that the problem was that Visio was not properly updating the cache of installed templates and stencils. In the end, the answer was to delete the cache and let Visio re-create it. The screenshots below show the custom shapes opened with the custom template and the More Shapes context menu. Before I deleted the cache, Visio incorrectly displayed the file name of some of the stencils (those with a trailing “_M” ) rather than the display name as entered into the PublishComponent table in Advanced Installer. In addition, the context menu did not show those stencils as being present in the workspace.
[Read more…] about Refreshing the cached installed files of VisioLinking Data to Shapes in Visio after using Data Visualizer
Data Visualizer (DV) in Visio Plan 2 (Data | Create from Data | Create ) is great because it provides a way of automatically creating a diagram from data, but it also prevents some of the other data-linking features in Visio from being used. This is because DV wants to take control of the data in the shapes to provide refreshes from the data source or send updates to the data source. This can be very annoying if you use DV to create the initial layout, then you enhance this, so it looks just perfect, and then you just want to update some of the data without affecting the layout. DV may re-layout your carefully crafted diagram, even if there are no updates to the data that should do that. Also, you may want to integrate data from other sources that were not available or accessible to the table or query used for by Data Visualizer. This is when you may want to use Data | External Data | Custom Import which also provides a much greater number of data source types. In this article, you will learn how you can do this manually, or automate it with the help of a little VBA code (or similar).
In this example, I have used table of personnel that I have used before, but added an extra column, Shape Type, that simply has the value Rectangle, which is simply the name of a simple Master shape that I have added to my macro-enabled stencil, ExDataLinker.vssm.
[Read more…] about Linking Data to Shapes in Visio after using Data Visualizer















