E
epatrizi
Using the code below, I am inspecting the connection information in my
drawing. I have various custom shapes connected using dynamic
connectors. Some of the shapes have inward connection points and some
of the shapes have outward connection points. The dynamic connectors
seem to only be able to identify the shapes that it is connected to by
an inward connection point. The dynamic connector cannot seem to
identify the shape associated with the outward connection point.
Changing the outward connection point to inward fixes the problem but I
do not understand. You should see two entries for each dynamic
connector in the output at the bottom, one for each shape it connects.
Thx
Public Sub ToSheet_Example()
Dim vsoShapes As Visio.Shapes
Dim vsoShape As Visio.Shape
Dim vsoConnectTo As Visio.Shape
Dim vsoConnects As Visio.Connects
Dim vsoConnect As Visio.Connect
Dim intCurrentShapeIndex As Integer
Dim intCounter As Integer
Set vsoShapes = ActivePage.Shapes
'For each shape on the page, get its connections.
For intCurrentShapeIndex = 1 To vsoShapes.Count
Set vsoShape = vsoShapes(intCurrentShapeIndex)
Set vsoConnects = vsoShape.Connects
'Debug.Print vsoShape.Name;
'For each connection, get the shape it connects to.
For intCounter = 1 To vsoConnects.Count
Set vsoConnect = vsoConnects(intCounter)
Set vsoConnectTo = vsoConnect.ToSheet
'Print the name of the shape the
'Connect object connects to.
Debug.Print vsoShape.Name; "->"; vsoConnectTo.Name
Next intCounter
Next intCurrentShapeIndex
End Sub
Output:
Dynamic connector->Sheet.219
Dynamic connector.259->Sheet.219
Dynamic connector.260->Sheet.219
Dynamic connector.261->Sheet.219
Dynamic connector.262->OR-24
Dynamic connector.262->DO
Dynamic connector.276->AND-12
Dynamic connector.276->DO.269
Dynamic connector.284->Dynamic connector.262
Dynamic connector.284->Sheet.266
drawing. I have various custom shapes connected using dynamic
connectors. Some of the shapes have inward connection points and some
of the shapes have outward connection points. The dynamic connectors
seem to only be able to identify the shapes that it is connected to by
an inward connection point. The dynamic connector cannot seem to
identify the shape associated with the outward connection point.
Changing the outward connection point to inward fixes the problem but I
do not understand. You should see two entries for each dynamic
connector in the output at the bottom, one for each shape it connects.
Thx
Public Sub ToSheet_Example()
Dim vsoShapes As Visio.Shapes
Dim vsoShape As Visio.Shape
Dim vsoConnectTo As Visio.Shape
Dim vsoConnects As Visio.Connects
Dim vsoConnect As Visio.Connect
Dim intCurrentShapeIndex As Integer
Dim intCounter As Integer
Set vsoShapes = ActivePage.Shapes
'For each shape on the page, get its connections.
For intCurrentShapeIndex = 1 To vsoShapes.Count
Set vsoShape = vsoShapes(intCurrentShapeIndex)
Set vsoConnects = vsoShape.Connects
'Debug.Print vsoShape.Name;
'For each connection, get the shape it connects to.
For intCounter = 1 To vsoConnects.Count
Set vsoConnect = vsoConnects(intCounter)
Set vsoConnectTo = vsoConnect.ToSheet
'Print the name of the shape the
'Connect object connects to.
Debug.Print vsoShape.Name; "->"; vsoConnectTo.Name
Next intCounter
Next intCurrentShapeIndex
End Sub
Output:
Dynamic connector->Sheet.219
Dynamic connector.259->Sheet.219
Dynamic connector.260->Sheet.219
Dynamic connector.261->Sheet.219
Dynamic connector.262->OR-24
Dynamic connector.262->DO
Dynamic connector.276->AND-12
Dynamic connector.276->DO.269
Dynamic connector.284->Dynamic connector.262
Dynamic connector.284->Sheet.266