Find connector of a shape with VBA

M

Madla

I'm stuck with Powerpoint's connectors.
Is it possible to find the connector shapes that are attached to an
autoshape.
I can't find a method or property that seems to support this.

Here's what I'm trying to do:
I want to change out a selected group of autoshapes with another group
of shapes. When I delete the old group, the connections are lost. So I
want to reattach them to the appropriate spot on the new group.

The only solution I see is walking through all shapes on the slide and
capturing every connector to the selected group, then change the group
and reattach. I'm worried about speed though, as I'm dealing with
slides that have 100-200 groups and connectors.

Any ideas would be appreciated...martin
 
S

Shyam Pillai

Madla,
The ConnectorFormat object for any connector shape gives you properties by
which you can determine whether the shape is connected to a shape and the
shape reference to that shape.
' Select a connector or get a reference to a connector shape and then you
can query:
First check if the shape is connected at the any end. This should return
True/False
ActiveWindow.Selection.ShapeRange(1).ConnectorFormat.BeginConnected
ActiveWindow.Selection.ShapeRange(1).ConnectorFormat.EndConnected

' Determine the shape to which the connector is attached.
ActiveWindow.Selection.ShapeRange(1).ConnectorFormat.BeginConnectedShape.Nam
e
ActiveWindow.Selection.ShapeRange(1).ConnectorFormat.EndConnectedShape.Name
 
M

Madla

I was hoping I can find out what autoshapes are connected via connectors
to the selected autoshape.
Looks like I'm out of luck. Thanks...martin
 

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