The new Visio 2013 software development kit is now available for download, and if you’ve not come across previous versions I thought I’d write a quick review of what’s inside.
Download and install
Although I’m just going to talk about the 2013 SDK in this post, here is a list of the SDK downloads back to 2003, so if you’re not yet running 2013 on your machine, there’s a matching download for your system and the general structure of the SDK is largely unchanged over the previous years:
Note that both the 2010 and 2013 downloads come with 32 and 64 bit versions of the SDK so make sure you download the one that matches the equivalent version of Visio that you’re running.
The default installed path is:
- [x86] C:\Program Files (x86)\Microsoft Office\Office15\VisSDK
- [x64] C:\Program Files\Microsoft Office\Office 15\VisSDK
Once the SDK’s installed, you should find three new tools available on the Developer ribbon tab:
Event monitor – The Event monitor is a great tool for discovering which events Visio is firing. You can see the effects a particular change has of on Documents, Pages and Shapes, and identify what ScopeIDs a particular sequence occurs in. Although the Event monitor doesn’t report events in addons/ins it can still be very useful if you’re trying to understand what a particular addon is doing to your shapes by watching for FormulaChanged events, for example. I wrote about this scenario in a previous post so have a look at Using the event monitor tool if that’s of interest.
Persistent Events – As a solution developer you can subscribe to an event that is ‘persisted’ with the document i.e. beyond the lifetime of the reference held in memory. For example, if you open an Org Chart document (or other template types that rely on add-on code) you can fire up the Persistent Events tool to inspect which events are subscribed to, which add-ons will be called when those events are hit, and the arguments passed in those calls. The tool allows you to either edit you’re own events to your own templates or view those in other templates to track down how a particular solution might be behaving.
Print ShapeSheet – Of the above tools, I guess this is the one I use the least, but it can be handy for comparing two ShapeSheets for differences as you can copy a listing of the Cell name, value and formula to a spreadsheet.
Solution Publishing Tool – The final tool in the SDK is not available via UI, but is a key part of creating a solution installation that includes additional files such as help, stencils and templates. You can find the tool under the ‘Tools’ folder of the SDK, which in my machine is:
- C:\Program Files (x86)\Microsoft Office\Office15\VisSDK\Tools
As I mentioned the online documentation only includes the standard reference details. If you want an offline version then you’ll get that with the SDK and also the code samples library, which gives you a wide range of samples (see the image at bottom of this post) in C#, VB.NET and VBA (note – VBA samples only appeared in the 2010 SDK onwards).
I find myself using the offline help pretty regularly so creating a shortcut can help. As it’s a compiled help file (.chm), however, you need to create a shortcut to the MS HTML Help executable and pass the path to the chm file as an argument:
Type libraries, and sample applications
If you dig further down in the SDK sub-folders (‘Libraries’) you’ll discover three type libraries (Visio, Save as Web and MS Visio Drawing Control) and library files for writing C and C++ based solutions.
Finally there are a number of sample applications covering VSTO add-ins, VSL add-ons and the Visio Drawing control in a range of languages (VB.NET, C# and C++).
So, if you need any encouragement to download the SDK then here’s a (yes, long) screenshot of the code sample library: