如何在VBA PPT中连接两个相同形状的节点和连接线?

时间:2017-10-27 10:23:57

标签: vba powerpoint

我正在尝试使用连接线连接到形状的节点,这是我的代码,任何人都可以帮忙解决这个问题。

With ActiveWindow.Selection.SlideRange(1).Shapes.AddConnector(Type:=msoConnectorStraight, BeginX:=0, _
        BeginY:=0, EndX:=100, EndY:=100).ConnectorFormat

    .BeginConnect ConnectedShape:=Shp, ConnectionSite:=3
    .EndConnect ConnectedShape:=Shp, ConnectionSite:=1        
    .Parent.RerouteConnections

End With

1 个答案:

答案 0 :(得分:0)

ConntectedShape不应该指的是不同的形状,还是这里的拼写错误?

With ActiveWindow.Selection.SlideRange(1).Shapes.AddConnector(Type:=msoConnectorStraight, _
        BeginX:=0, BeginY:=0, EndX:=100, EndY:=100).ConnectorFormat
    .BeginConnect ConnectedShape:=Shp, ConnectionSite:=3 ' <-- Shp1?
    .EndConnect ConnectedShape:=Shp, ConnectionSite:=1 ' <-- Shp2?
    .Parent.RerouteConnections
End With