K
Ken K.
How do I make sure I use a specific connection point? For a basic flow chart box I want to connect to the bottom connector (X3?) and to the top of the next box (X4?). When I use the show shape sheet, I can see the connection point I want but I can not get it to connect using the following code. I pulled the example from the SDK.
Thanks,
Ken
Public Sub ConnectWithDynamicGlueAndConnector( _
vsoShapeFrom As Visio.Shape, _
vsoShapeTo As Visio.Shape)
' Parameters
' vsoShapeFrom The shape from where the dynamic
' connector begins
'
' vsoShapeTo The shape from where the dynamic
' connector ends
Dim vsoApplication As Visio.Application
Dim vsoStencil As Visio.Document
Dim vsoMaster As Visio.Master
Dim vsoConnector As Visio.Shape
Dim vsoBeginX As Visio.Cell
Dim vsoEndX As Visio.Cell
On Error GoTo ConnectWithDynamicGlueAndConnector_Err
' Get the Application object from the shape.
Set vsoApplication = vsoShapeFrom.Application
' Access the Basic Flowchart Shapes stencil.
Set vsoStencil = vsoApplication.Documents.OpenEx( _
"Basic Flowchart Shapes (US units).vss", _
visOpenDocked)
' Get the master on the stencil by its universal name.
Set vsoMaster = vsoStencil.Masters.ItemU( _
"Dynamic Connector")
' Add connector to the page.
Set vsoConnector = vsoApplication.ActivePage.Drop( _
vsoMaster, 0, 0)
' Connect the begin point to the PinX of a 2-D shape.
Set vsoBeginX = vsoConnector.CellsSRC( _
visSectionObject, visRowXForm1D, vis1DBeginX)
vsoBeginX.GlueTo vsoShapeFrom.CellsSRC( _
visSectionObject, visRowXFormOut, visXFormPinX)
' Connect the end point to the PinX of another 2-D
' shape.
Set vsoEndX = vsoConnector.CellsSRC( _
visSectionObject, visRowXForm1D, vis1DEndX)
vsoEndX.GlueTo vsoShapeTo.CellsSRC( _
visSectionObject, visRowXFormOut, visXFormPinX)
Exit Sub
ConnectWithDynamicGlueAndConnector_Err:
MsgBox Err.Description
End Sub
Thanks,
Ken
Public Sub ConnectWithDynamicGlueAndConnector( _
vsoShapeFrom As Visio.Shape, _
vsoShapeTo As Visio.Shape)
' Parameters
' vsoShapeFrom The shape from where the dynamic
' connector begins
'
' vsoShapeTo The shape from where the dynamic
' connector ends
Dim vsoApplication As Visio.Application
Dim vsoStencil As Visio.Document
Dim vsoMaster As Visio.Master
Dim vsoConnector As Visio.Shape
Dim vsoBeginX As Visio.Cell
Dim vsoEndX As Visio.Cell
On Error GoTo ConnectWithDynamicGlueAndConnector_Err
' Get the Application object from the shape.
Set vsoApplication = vsoShapeFrom.Application
' Access the Basic Flowchart Shapes stencil.
Set vsoStencil = vsoApplication.Documents.OpenEx( _
"Basic Flowchart Shapes (US units).vss", _
visOpenDocked)
' Get the master on the stencil by its universal name.
Set vsoMaster = vsoStencil.Masters.ItemU( _
"Dynamic Connector")
' Add connector to the page.
Set vsoConnector = vsoApplication.ActivePage.Drop( _
vsoMaster, 0, 0)
' Connect the begin point to the PinX of a 2-D shape.
Set vsoBeginX = vsoConnector.CellsSRC( _
visSectionObject, visRowXForm1D, vis1DBeginX)
vsoBeginX.GlueTo vsoShapeFrom.CellsSRC( _
visSectionObject, visRowXFormOut, visXFormPinX)
' Connect the end point to the PinX of another 2-D
' shape.
Set vsoEndX = vsoConnector.CellsSRC( _
visSectionObject, visRowXForm1D, vis1DEndX)
vsoEndX.GlueTo vsoShapeTo.CellsSRC( _
visSectionObject, visRowXFormOut, visXFormPinX)
Exit Sub
ConnectWithDynamicGlueAndConnector_Err:
MsgBox Err.Description
End Sub