S
Steve in SF
I would like to get a shapes connection into a custom property cell of the
shape. This will work for a string but not for the return from the
vsoConnect.ToSheet. What am I missing?
Thanks,
-Steve
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
Dim celObjCustomProp1 As Visio.Cell, celObjCustomProp2 As Visio.Cell
Set vsoShape = Visio.ActiveWindow.Selection.Item(1)
Set vsoConnects = vsoShape.Connects
'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 vsoConnectTo.Name
Set celObjCustomProp1 = vsoShape.CellsU("Prop.Row_1.Label")
'On Error Resume Next
celObjCustomProp1.Formula = vsoConnectTo
shape. This will work for a string but not for the return from the
vsoConnect.ToSheet. What am I missing?
Thanks,
-Steve
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
Dim celObjCustomProp1 As Visio.Cell, celObjCustomProp2 As Visio.Cell
Set vsoShape = Visio.ActiveWindow.Selection.Item(1)
Set vsoConnects = vsoShape.Connects
'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 vsoConnectTo.Name
Set celObjCustomProp1 = vsoShape.CellsU("Prop.Row_1.Label")
'On Error Resume Next
celObjCustomProp1.Formula = vsoConnectTo