Hide objects conditionally

T

tjtjjtjt

My company has us work with a standard diagram that will have many diferent
events and related content. All events are connected to appropriate related
content using connectors.
Is it possible with VBA to hide all shapes not connected to the currently
selected shape?
I would like to select an event and then hide all other events and realted
content shapes not related to the selected event.

Thanks.
 
C

Chris Roth [MVP]

Hi TJ,

Yes you can do this in a number of ways using code/VBA.

The first thing you need to do is fnd all the shapes connected to your
shape. The usual way to do this is to examine the shape's FromConnects
collection.

If you look on John Marshall's web site at: http://visio.mvps.org/VBA.htm,
you'll see in the Add Shape Numbers some examples of how to use this. Search
the page for "Find the shapes connected directly below this shape" to find
the bit of code I'm talking about.

There are a number of ways to hide shapes. My article "The Hidden World of
Visio Shapes" --
http://www.visguy.com/2006/09/05/the-hidden-world-of-visio-shapes/ discusses
a lot of them.

I think a nice effect might be to select all the shapes that you want to
hide, place them on a temporary layer (give it a nice obscure name like
"nonconnected.hideshapes.layer", place all the non-connected shapes on the
layer, then give that layer a 75% transparent, gray fill color. That way the
non-connected shapes won't completely disappear, but will fade into the
background.


--
Hope this helps,

Chris Roth
Visio MVP

Free Visio shapes:
http://www.visguy.com/category/shapes
Visio programming info:
http://www.visguy.com/category/programming/
Other Visio resources:
http://www.visguy.com/visio-links/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top