connects into custom properties cell

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
 
J

JuneTheSecond

vsoConnectTo is shape, and default property is name, and name is string.
If you enter string that cannnot be evaluated as Visio formula, string must
be double qoted, like,
celObjCustomProp1.Formula = DQ(vsoConnectTo.NameU)
End Sub
Function DQ(s As String)
DQ = Chr(34) & s & Chr(34)
End Function
 

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