你可以胶水
.Cells(“BeginX”)
要么
.Cells(“EndX”)
连接器
要么是最接近形状的连接器:
Shape.Cells(“PinX”)
或选定的连接器:
Shape.CellsSRC(visSectionConnectionPts, row, column)
可用连接点的数量取决于您的形状类型
如果单击形状并通过鼠标右键单击打开其ShapeSheet,您将找到“连接点”部分。此表的每一行代表一个连接点 - 单击表中的行,然后查看在图形中选择的那一行。
使用以0开头的行号
CellSRC
列号不相关,可以是0或1 = visCnnctX或visCnnctY
或者只是与宏录制器进行手动连接
并在代码中搜索e。 G。
CellSRC(7, 0, 0)
7 = visSectionConnectionPts,0 =第一个连接点,0
Dim myConnector As Visio.Shape‘ drop it somewhere
Set myConnector = ActiveWindow.Page.Drop(Application.ConnectorToolDataObject, 1, 10)‘ connect it to the nearest connection point of a shape (varies if you drag)
myConnector.Cells(“BeginX”).GlueTo BoxShape.Cells(“PinX”)‘ connect it a fixed connection point (example if shape has 4 points)
myconnector.Cells(“BeginX”).GlueTo _
Boxshape.CellsSRC(visSectionConnectionPts, 0, 0) ‘ left
‘ .CellsSRC(visSectionConnectionPts, 1, 0) ‘ right
‘ .CellsSRC(visSectionConnectionPts, 2, 0) ‘ top
‘ .CellsSRC(visSectionConnectionPts, 3, 0) ‘ bottom</code>
</醇>