Shape Exporter: Export any Shape from any Stencil in Visio (2013) to PNG

The other day a customer told me he was “sick and tired” of people asking him to export shapes from Visio to a PNG file.

The customer works for a relatively small company that only has 1 Microsoft Visio license available. Other people in the company need the shapes on a regular basis for use in Word or Powerpoint documents.

I started out by showing him how to export a shape using a Macro in Visio, which eliminated several steps in exporting to PNG format.
Several minutes later I used the same Macro to run through ALL the shapes in ALL the stencils the customer had. All shapes were now exported to PNG on a file share. Problem solved.

For anyone with the same needs, I published the macro enabled Visio file on the TechNet Gallery here.

Usage is actually quite simple.

  • Open the ShapeExporter.vsdm file making sure you allow Macros to run.
  • Add one or more stencils to the ShapeExorter document.
  • Click the “Export Shapes” button, or run the Macro from the Developer Ribbon.
  • Check the results :)

It exports to %UserProfile%\Desktop\Shapes but you can change this if needed, just edit the Macro.


Open ShapeExporter.vsdm:

This screenshot clearly shows the Export Shapes button.

Add at least 1 stencil:

And click the Export Shapes button. Note that this can take a while if you have a lot of stencils added, or if there is a large number of shapes to be exported.
Just be patient until a little message pops up:

Then check the results on a Shapes folder on your desktop (if you didn’t change the output path in the Macro):

So there you have it. It took longer to create the screenshots, upload to the TechNet Gallery and write a blog post about it, then it did creating this, but hey, it gets the job done, and I’m sure someone will find use for it :)



20+ years experience in Microsoft powered environments. Enjoy automating stuff using scripts, powershell, and even batch files. In my free time (hah! as if there is any) I hunt achievements and gamerscore on anything Xbox Live enabled (Windows Mobile, Windows 8, Windows 10, Xbox 360 and Xbox One). When I'm not doing that I enjoy traveling or riding my Yamaha R1 on the edge ;)

Tagged with: , , ,
Posted in Tools

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog Authors

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 400 other followers

Blog Stats
  • 2,725,093 hits
  • An error has occurred; the feed is probably down. Try again later.
%d bloggers like this: