Sunday 14 June 2015


A Free Document Productivity Tool For Visio

This post provides a tool to resize a group of shapes based on the size of the first one selected.  It assigns the shapes to a group so that the group can be selected and moved, and be easily resized to conform to the new size any one of them.

This is the first in a series of productivity tools for Visio that are avaialble for free download. The tools in this series are:
  • SmartSize –Making a group of shapes the same size and allowing them to be resizing later.
  • SmartAlign – Aligning a group of shapes and allowing them to be realigned later.
  • BreakLinks – Disconnecting the connectors from a shape so that it can be moved without dragging the connectors out of place.

Using the Tool

First, select the shape that you want the others to be resized to.

Second select one or more other shapes.  Note that the first shape has a darker purple boundary than the other shapes.

Finally, Press the shortcut key (Ctl+m)to resize the shapes to the size of the first one selected.

Using the tool on these shapes later.

When a set of shapes is resized, they are assigned to a group.

If you select any one of those shapes  and press the shortcut key.  The rest of the group is selected.

A second press of the shortcut key will resize the group to confirm to size of the first of the group just selected.

You can add to the  group by holding the control key and selecting further

Marcos in Visio

A Free Document Productivity Tool For Visio

This post outlines how to access and use the upcoming Visio tools to be posted shortly.

General Concept

The code for the tools is available from a template that you can download from here.  The idea is to create your own template and copy the published code into into it, then assign each tool to a shortcut key so that it can be quickly accessed.

I have chosen this method to distribute the code so that it can be inspected to show that it is safe to use, and so that it can be used as a learning aid. This is a bare bones approach that is consistent with the approach used for the Word tools and give the user the best control of the process.

Keeping the code in the template means that there is no code in each of the documents created. Other users of the document are therefore not impacted by the tools. 

The downside is that you will probably need several copies of the code in each of the templates that you use, and need to update each when new code is issued.

Copying the code is quite simple and only takes a minute or two.

Creating a New Template

To create a template, take a diagram or start with a blank diagram and use the save as dialogue to create save the document as a "Visio Macro-Enabled Template" (*.vstm) 

I recommend taking the time to get this template just right for the diagram you are working on.  For example, get the default connector correct so you don't have to change format each time, get the view and layout correct and open the usual stencils so these are always at hand for any new diagrams.

Download the Code

Down load the tools template form here. Then open the downloaded template.

Adding Code to the Template

Ensure that the Developer tab is visible.  See the entry at the bottom of the post to do this.

Now open VBA and create a new module.