Table of contents
TOC
折叠目录
展开目录

Shape.ConnectionSiteCount 属性 (PowerPoint)Shape.ConnectionSiteCount Property (PowerPoint)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

返回指定形状中的连结点的数量。只读。Returns the number of connection sites on the specified shape. Read-only.

语法Syntax

表达式ConnectionSiteCountexpression. ConnectionSiteCount

表达式_一个表示一个Shape对象的变量。_expression A variable that represents a Shape object.

返回值Return Value

LongLong

示例Example

本示例将两个矩形添加myDocument,并用两个连接符将其连接。两条连接符起点将连接到连接站点上的第一个矩形;连接线的两端连接到第二个矩形的第一个和最后一个连接站点。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

Shape 对象Shape Object

© 2018 Microsoft