返回指定的形状上连接站点的数目。Long 类型,只读。
本示例向 myDocument
中添加了两个矩形,然后用两条连接符将这两个矩形连接起来。两条连接符的起点都连接在第一个矩形的第一个连接站点上;而两条连接符的终点则分别连接在第二个矩形的第一个和最后一个连接站点上。
Set myDocument = Worksheets(1)
Set s = myDocument.Shapes
Set firstRect = s.AddShape(msoShapeRectangle, _
100, 50, 200, 100)
Set secondRect = s.AddShape(msoShapeRectangle, _
300, 300, 200, 100)
lastsite = secondRect.ConnectionSiteCount
With s.AddConnector(msoConnectorCurve, _
0, 0, 100, 100).ConnectorFormat
.BeginConnect ConnectedShape:=firstRect, _
ConnectionSite:=1
.EndConnect ConnectedShape:=secondRect, _
ConnectionSite:=1
End With
With s.AddConnector(msoConnectorCurve, _
0, 0, 100, 100).ConnectorFormat
.BeginConnect ConnectedShape:=firstRect, _
ConnectionSite:=1
.EndConnect ConnectedShape:=secondRect, _
ConnectionSite:=lastsite
End With