Open Shape Surgery for the Visio Developer

One of the first gotchas for new Visio developers is the UnGroup command.

Visio shapes are simple, they can have one colour and one line type. To make a traffic light, you need to group a red circle, yellow circle and a green circle. When grouped, Visio will take a collection of shapes and create a new shape with a group section and a shape collection of the shapes selected. To  ungroup, the shapes are released from the collection and the group shape is deleted. The process is reversible, some times. Shape developers learned early on, that this new shape was like any other shape and could have other sections added to it. Shape Data, User Data, Connections, Control Handles etc. Unfortunately, when these shapes are ungrouped, these extra sections are not preserved. So knowing this why would you ever want to ungroup one of these these?  You can always subselect or use the Drawing Explorer to get access to one of the sub shapes. Welcome to one of the other gotchas, the bounding box. Sometimes you have to ungroup, and create a group with a more appropriate bounding box. You can go bigger by adding a temporary shape of the desired size, lock the group from recalculating the bounding box and delete the temporary shape, but you can not go smaller without Ungrouping. You would then create a shape of the correct size, group it and before adding the other shapes to the group, lock the group shape from recalculating. The final cleanup would be to add back the component shapes and delete the temporary shape.

Early on Graham Wideman showed me a way to remove VBA projects from a Visio solution. Deleting the VBA only got you part of the way, there was still a Project stub that made Visio think the file contained a VBA solution. His solution was to edit the XML version of the file and delete the stub.

 

 

 

 

Published by johnvisiomvp

The original Visio MVP. I have worked with the Visio team since 1993