Using PowerShell to update Visio diagrams
I have been completing lots of work in Visio recently as part of document migration into a Enterprise Architecture tool called iServer. This required me to dust off my knowledge of VBA and creating lots of macros. I am not a massive fan of macros, they seem really archaic.
In the more recently iterations of these scripts, I realised that I could use PowerShell to complete the same tasks. PowerShell is something I am far more comfortable with and because it sits outside of the application itself, there is more opportunity to run scripts against a larger set of files.
Rather than bore you with some of the scripts I created for my business process diagrams, the below example is a script which you can use to update IT related documents.
Below I have a rack diagram I created in Visio. It has four servers and one router with their names added to ShapeData and a Data Graphic which shows this as a bubble.
Now, wouldn't be cool if you could update all of your documents with IP address without having to sit there typing it in? Well that is what I did!
This is the result
You can see how this script could be edited to complete any manner of tasks. If the information was in the Shape text itself you could use this
To see what else you can do programmatically with Visio, please see the MSDN page.
Got any tedious Visio task that you could do with automating? Let me know in the comments.