#PowerShell Corner – Exporting Visio Stencils as Vectors

By | August 29, 2015

This script is the result of me wanting to use some Microsoft supplied visio shapes in hi-res form which I historically achieved by (I kid you not) scaling them up in Visio and then snipping them into other documents.

I stumbled across a piece of .NET code that did something similar (if I ever see it again, I will cite it here) and took the inspiration it provided to come up with this little script.

In short, we instantiate Visio as a COM object, load the stencil we want into the Visio session and then iterate through the stencil exporting all of the shapes to the file system. What makes this useful? Visio stencils contain vector images (so they can be infinitely scaled) which I can then use in other tools (such as Adobe Illustrator) to awesome effect.

Why publish here? For posterity and as an example of how the Office Interop can be easily leveraged from within PowerShell. Simples.

more to follow…

One thought on “#PowerShell Corner – Exporting Visio Stencils as Vectors

  1. Amit Kumar

    Hi, when export visio stencils using script .. if visio stencils shape have connection point or custom properties then not show SVG image.. it will work if no connection point and properties

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *