Visio vba将动态连接器连接到连接点


纾潆锦袖迷子
2025-03-10 01:41:30 (11天前)
  1. 我在连接一个实际连接到预定义连接点而不是仅连接到顶部的链接动态连接器时遇到了麻烦。

我的主人在…有一些文本框

2 条回复
  1. 0# 子阳 | 2019-08-31 10-32



    你可以胶水

    .Cells(“BeginX”)

    要么

    .Cells(“EndX”)

    连接器




    1. 要么是最接近形状的连接器:

      Shape.Cells(“PinX”)



    2. 或选定的连接器:

      Shape.CellsSRC(visSectionConnectionPts, row, column)


    3. </醇>




      • 可用连接点的数量取决于您的形状类型



      • 如果单击形状并通过鼠标右键单击打开其ShapeSheet,您将找到“连接点”部分。此表的每一行代表一个连接点 - 单击表中的行,然后查看在图形中选择的那一行。

        使用以0开头的行号

        CellSRC


        列号不相关,可以是0或1 = visCnnctX或visCnnctY





      • 或者只是与宏录制器进行手动连接

        并在代码中搜索e。 G。



        CellSRC(7, 0, 0)

        7 = visSectionConnectionPts,0 =第一个连接点,0








      1. Dim myConnector As Visio.Shape

      2. drop it somewhere
        Set myConnector = ActiveWindow.Page.Drop(Application.ConnectorToolDataObject, 1, 10)

      3. connect it to the nearest connection point of a shape (varies if you drag)
        myConnector.Cells(“BeginX”).GlueTo BoxShape.Cells(“PinX”)

      4. 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

      5. </code>

登录 后才能参与评论