Visio Guy

Visio Discussions => General Visio => Topic started by: RhesusMinus on August 31, 2011, 09:57:45 PM

Title: Saving a selection to a stencil
Post by: RhesusMinus on August 31, 2011, 09:57:45 PM
Hi There.

See attached file.

The small rectangle have two connection points, so that several copies can be chained, as in the lower rectangles.

I can put the single rectangle into a stencil, no problem, easy to use.

I would however like to create an item in the stencil wich consists of the row of chained rectangles. This is because somtetimes I need this specific number of shapes in a row.
But.. when putting this selection into a stencil, and inserting it back onto a drawing, they are grouped together, so I have to ungroup them manually.
Is there a way to make them be separate rectangles, glued to each other, when they're inserted from a stencil?

The reason I need them to be separate, are that I'm running a report on these, and the reportgenerator can't find the shapes when they are inside the group.

THL
Title: Re: Saving a selection to a stencil
Post by: Jumpy on September 01, 2011, 06:26:30 AM
When you put seperate shapes together in a stencil, they get grouped automatically.
Afaik there's no way to prevent that.

The Workarround for you is:
- Prior to placing them in the stencil, group them yourself.
- In the ShapeSheet of the group, in the event section, in the OnDrop-Cell place formula: =CALLTHIS("MyMacro","MyVBAProject")
- Place a VBA-Macro "MyMacro" in a VBA-Project of the stencil (so the macro "travels" with the shape).
(- To do so, the stencil has to be in Edit-Mode)
- Macro should look like in this thread:

http://visguy.com/vgforum/index.php?topic=26.0

hth Jumpy
Title: Re: Saving a selection to a stencil
Post by: RhesusMinus on September 01, 2011, 08:51:09 AM
Thanks Jumpy, I'll give it a try!

THL