Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Latest commit

 

History

History
70 lines (41 loc) · 1.6 KB

shaperange-connectionsitecount-property-powerpoint.md

File metadata and controls

70 lines (41 loc) · 1.6 KB
title keywords f1_keywords ms.prod api_name ms.assetid ms.date
ShapeRange.ConnectionSiteCount Property (PowerPoint)
vbapp10.chm548019
vbapp10.chm548019
powerpoint
PowerPoint.ShapeRange.ConnectionSiteCount
352f9c7c-6290-f974-5924-01e108fb4919
06/08/2017

ShapeRange.ConnectionSiteCount Property (PowerPoint)

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

Syntax

expression. ConnectionSiteCount

expression A variable that represents a ShapeRange object.

Return Value

Long

Example

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

See also

Concepts

ShapeRange Object