ConnectorFormat.BeginConnectionSite 属性 (Excel)ConnectorFormat.BeginConnectionSite property (Excel)

返回一个整数,该整数指定连接符的始端所连接的连接结点。Returns an integer that specifies the connection site that the beginning of a connector is connected to. 只读 LongRead-only Long.

语法Syntax

expressionexpression. BeginConnectionSite

_表达式_一个代表ConnectorFormat对象的变量。expression A variable that represents a ConnectorFormat object.

注解Remarks

如果指定连接符的始端未连接到形状,该属性会产生错误。If the beginning of the specified connector isn't attached to a shape, this property generates an error.

示例Example

此示例假定myDocument已包含两个名为"Conn1To2。"连接符所连接的形状This example assumes that myDocument already contains two shapes attached by a connector named "Conn1To2." 该代码将添加一个矩形,向连接器myDocumentThe code adds a rectangle and a connector to myDocument. 新的连接符的起点将附加到"conn1to2"连接符的起点的同一连接站点和新的连接符的终点将附加到连接网站上的新矩形。The beginning of the new connector will be attached to the same connection site as the beginning of the connector named "Conn1To2," and the end of the new connector will be attached to connection site one on the new rectangle.

Set myDocument = Worksheets(1) 
With myDocument.Shapes 
 Set r3 = .AddShape(msoShapeRectangle, 450, 190, 200, 100) 
 .AddConnector(msoConnectorCurve, 0, 0, 10, 10).Name = _ 
 "Conn1To3" 
 With .Item("Conn1To2").ConnectorFormat 
 beginConnSite1 = .BeginConnectionSite 
 Set beginConnShape1 = .BeginConnectedShape 
 End With 
 With .Item("Conn1To3").ConnectorFormat 
 .BeginConnect beginConnShape1, beginConnSite1 
 .EndConnect r3, 1 
 End With 
End With

另请参阅See also

ConnectorFormat 对象ConnectorFormat Object