Visio Guy

Visio Discussions => Visio 2013 Issues => Topic started by: dtallent on March 24, 2017, 03:46:00 PM

Title: making macros more available
Post by: dtallent on March 24, 2017, 03:46:00 PM
I am using a macro while working on a blueprint. Is there a way to save this macro so that I can use it on another blueprint without having to create an entirely new macro for every blueprint?
Title: Re: making macros more available
Post by: Surrogate on March 24, 2017, 06:46:59 PM
What you mean as blueprint ?
Title: Re: making macros more available
Post by: wapperdude on March 24, 2017, 09:30:30 PM
Begging the question that Surrogate raised, rather, assuming your just talking about macros that you wrote for a Visio file that your working on, and now want them to be more universally available.  There are a variety of ways:

1.) After you have working macros you can go to the VBA window and do either:
      a) select each macro individual, go to File > Export.  Pick a directory to place the file, give it a name and save.  Do for each macro.
     b) in the project drawing window (show tree structure), select, e.g., ThisDocument, and do export.  This will export all of the macros at once. 
     c) to retrieve the macro(s), do import.  Note, these are typically .cls files.  Method a lets you chose individual macros; method b you get all of them.

2.)  Add the macros to the stencil containing your shapes.  The macros will travel with the stencil.

3)  Save your file as a template.  All of your settings will load up.

That's it in a nutshell.

Wapperdude