Share via


Shape.ConnectionSiteCount Property

Returns the number of connection sites on the specified shape. Read-only.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
ReadOnly Property ConnectionSiteCount As Integer
    Get
'Usage
Dim instance As Shape
Dim value As Integer

value = instance.ConnectionSiteCount
int ConnectionSiteCount { get; }

Property Value

Type: System.Int32
Long

Examples

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

See Also

Reference

Shape Interface

Shape Members

Microsoft.Office.Interop.PowerPoint Namespace