EndConnectedShape 属性

       

返回 Shape 对象,该对象代表指定的连接符终点连接的图形。只读。

注意   如果指定的连接符的终点没有连接到一个图形上,则该属性产生一个错误。

示例

本示例假定在 myDocument 上,有两个用连接符“Conn1To2”连接起来的图形。本示例的代码将向 myDocument 添加一个矩形和一个连接符。新添加的连接符的终点将连接到“Conn1To2”的终点所连接的同一个连接站点上,而新添加的连接符的起点则连接到新添加的矩形的第一个连接站点上。

Set myDocument = Worksheets(1)
With myDocument.Shapes
    Set r3 = .AddShape(msoShapeRectangle, _
        100, 420, 200, 100)
    With .Item("Conn1To2").ConnectorFormat
        endConnSite1 = .EndConnectionSite
        Set endConnShape1 = .EndConnectedShape
    End With
    With .AddConnector(msoConnectorCurve, _
            0, 0, 10, 10).ConnectorFormat
        .BeginConnect r3, 1
        .EndConnect endConnShape1, endConnSite1
    End With
End With