I love this thing. I've developed similar add-ins that I've called "Abut" because this shoves shapes together. This, by the way, is really, really, really, really useful!
Anyway, I've just modified wapperdude's offering in the following way:
- Moved code into a macro-enabled stencil, entitled VBA Alignment Tools.vssm
- Launch the form as "modeless", so it stays open all the time. You may have to click twice when going from the form back into a Visio drawing, but you get used to that quickly.
- Created a shape that you can double-click to launch the form. Just drag it onto a page and double-click it, rather than figure out how to launch macros from the ribbon (View > Macros > Macros...)
- The stencil can be placed in the folder: %userprofile%\Documents\My Shapes
- You can also access the My Shapes folder via Shapes > More Shapes > My Shapes > Organize My Shapes
- As a stencil, the code can now be accessed by any document. Just Go to Shapes > More Shapes > My Shapes and pick the stencil.
By putting code in a stencil, you increase flexibility by allowing easy access to the code from any drawing, and you decrease "code proliferation", where many documents contain variants of the code. Also, documents no longer contain VBA code, so sending them to people who don't want to run code or aren't allowed to run code can still use the documents. The code-stencil functions as an add-in that users can choose to load or not load.
Cheers,
Chris