Public
Function
GetShapeConnectors(Shape
As
Excel.Shape)
As
VBA.Collection
Dim
shp
As
Excel.Shape
Dim
shpChild
As
Excel.Shape
Set
GetShapeConnectors =
New
VBA.Collection
For
Each
shp
In
Shape.Parent.Shapes
If
shp.Connector
Then
With
shp.ConnectorFormat
If
Shape.Type <> msoGroup
Then
If
.BeginConnected
Then
If
.BeginConnectedShape
Is
Shape
Then
Call
GetShapeConnectors.Add(shp)
End
If
End
If
If
.EndConnected
Then
If
.EndConnectedShape
Is
Shape
Then
Call
GetShapeConnectors.Add(shp)
End
If
End
If
Else
For
Each
shpChild
In
Shape.GroupItems
If
.BeginConnected
Then
If
.BeginConnectedShape
Is
shpChild
Then
Call
GetShapeConnectors.Add(shp)
End
If
End
If
If
.EndConnected
Then
If
.EndConnectedShape
Is
shpChild
Then
Call
GetShapeConnectors.Add(shp)
End
If
End
If
Next
End
If
End
With
End
If
Next
End
Function