searching for shapes
Re Q1, this functionality is built in.
Customize toolbars
Commands, Drawing, Select Multiple Objects
drag onto your Drawing toolbar
(to list programmatically see following)
Re Q2, you need to look for connectors and see if 'both ends' are connected.
This should get you started -
Sub ListConnections()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
If shp.Connector Then
With shp.ConnectorFormat
If .BeginConnected And .EndConnected Then ' only if both
ends ?
Debug.Print shp.Name, .BeginConnectedShape.Name, .EndConnectedShape.Name
End If
End With
Else
Debug.Print shp.Name
End If
Next
End Sub
How to turn the results into something useful depends on what you want to do
and could get a bit fiddly.
Regards,
Peter T
"#DIV/0" wrote in message
...
Hi,
1. How can I fill a listbox with the names of all the shapes in a
worksheet ?
I've given them meaningful names so I can identify them.
2. From a selected shape is there a way to find out the names of any
connected shapes ?
eg. shape1 is connected to shape2, shape3 and shape4. If I select shape1
can
I get a list of the connected shapes ? Verifying the presence of
connectors
and seeing what's at the other end ?
--
David M
WinXP - Office2003 (Italian)
|