Download the New Visio 2010 SDK!
Note that there are two versions of the SDK: one for 32-bit installations of Visio and one for 64-bit installations. Download the one that corresponds to your version of Visio.
I imagine some folks might have 64-bit Windows, but still have 32-bit Visio. In that case, my guess is that you would need the 32-bit SDK, not the 64-bit version.
The package is full of code samples, example projects and documentation. Here’s a quick summary of what you get:
- Code Samples Library
- Flowchart sample application
- TreeView sample application
- Office Plan sample application
- VSTO Add-in sample application
- Persistent Events tool
- Event Monitor tool
- Print ShapeSheet tool
- Solution Publishing tool
- Type libraries
- Visual Studio 2005/2008 wizards for creating Visio add-on projects
- Visio Automation Reference
- Save as Web Reference
- ShapeSheet (function) Reference
- Visio Viewer Reference
- Visio XML Schema Reference.
Once you’ve downloaded it and installed it, you might wonder where in the heck it’s gone to. I just looked for the yellow highlights that indicate “new installations” and located it under All Programs > Microsoft Office 2010 Developer Resources > Microsoft Visio 2010 SDK:
If you open the folder, you’ll see the five main offerings more closely:
This is all good stuff, but the item I use the most (by far!) is that wonderful help file: the Microsoft Visio SDK Documentation, with the big, yellow question mark!
It is full of references for every ShapeSheet function and automation call into the Visio object model that you’ll ever need, and that you’ve ever forgotten.
The Code Samples library also functions like a help file, and contains 86 code samples for common Visio tasks. The samples are translated into three languages: VB.NET, C# and VBA.
click to view larger image
The samples are divided into 12 main areas, including:
- Custom properties/Shape data
- Data connectivity
- Event handling
- Integration, layers
- User interface
But be sure to right-click a node in the contents panel and choose Open All. This will expand all of the sub-tree nodes for every code sample available and allow you to quickly browse all of the offerings in this great database of code samples!