title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
Shape.ConnectionSiteCount property (PowerPoint) |
vbapp10.chm547019 |
|
|
2180bb96-d205-03f3-1ace-355f34286b2e |
06/08/2017 |
medium |
Returns the number of connection sites on the specified shape. Read-only.
expression.ConnectionSiteCount
expression A variable that represents a Shape object.
Long
This example adds two rectangles to myDocument and joins them with two connectors. The beginnings of both connectors attach to connection site one on the first rectangle; the ends of the connectors attach to the first and last connection sites of the second rectangle.
Set myDocument = ActivePresentation.Slides(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
[!includeSupport and feedback]