Accessing a Shape's Connectors

J

joegarber

So I know there have been many questions about this, but the answers
I've found haven't worked for me..

I have a loop that cycles through all the shapes on the page, and I
need to access each of the connectors glued to those shapes. How can I
access the ShapeSheet of those connectors in this way?

For example, for
Shape1 --- Connector --- Shape2
I want to access Cells(".....") for the Connector. I do realize that a
Connect object is not the same as a Shape object.... so how can I reach
its shapesheet?

It's killin me that I can't do this simple thing...
 
A

Al Edlund

I'd probably get the v2003 sdk which has a page connections routine in the
library.
al
 
J

joegarber

I've scoured the sdk online on msdn. I tried to figure this out before
posting on here, but to no avail. lil help?
 
J

John Marshall, MVP

Each Shape has two collections for connections. One lists the shapes that
are connected to it and the other lists shapes that it connects to. There is
also another connection collection attached to the page object, so you only
need to walk the connections rather than the shape collections.

' Check each shape connected to this shape
For curConnIndx = 1 To shpObj.FromConnects.Count

Set fromObj = shpObj.FromConnects(curConnIndx).FromSheet

For i1 = 1 To fromObj.Connects.Count
debug.print fromObj.Connects(i1).ToSheet.Name
Next i1

Next curConnIndx


--
John... Visio MVP

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples? http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm
Visio Wishlist http://www.mvps.org/visio/wish_list.htm
 
A

Al Edlund

thanks you sir, I appreciate the feedback. Glad to hear John is helping you
out.
al
 

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