Table of contents

Shape.ConnectorFormat 属性 (发布服务器)Shape.ConnectorFormat Property (Publisher)

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

返回一个ConnectorFormat对象,该对象包含连接器格式设置属性。适用于表示连接线的形状ShapeRange对象。只读的。Returns a ConnectorFormat object that contains connector formatting properties. Applies to Shape or ShapeRange objects that represent connectors. Read-only.


表达式ConnectorFormatexpression. ConnectorFormat

表示形状对象的 _expression_A 变量。_expression_A variable that represents a Shape object.


以下示例将两个矩形添加到当前出版物的第一页,并用曲线连接符将它们连接起来。This example adds two rectangles to the first page in the active publication and connects them with a curved connector.

Dim shpRect1 As Shape 
Dim shpRect2 As Shape 

With ActiveDocument.Pages(1).Shapes 

 ' Add two new rectangles. 
 Set shpRect1 = .AddShape(Type:=msoShapeRectangle, _ 
 Left:=100, Top:=50, Width:=200, Height:=100) 
 Set shpRect2 = .AddShape(Type:=msoShapeRectangle, _ 
 Left:=300, Top:=300, Width:=200, Height:=100) 

 ' Add a new curved connector. 
 With .AddConnector(Type:=msoConnectorCurve, _ 
 BeginX:=0, BeginY:=0, EndX:=100, EndY:=100) _ 

 ' Connect the new connector to the two rectangles. 
 .BeginConnect ConnectedShape:=shpRect1, ConnectionSite:=1 
 .EndConnect ConnectedShape:=shpRect2, ConnectionSite:=1 

 ' Reroute the connector to create the shortest path. 
 End With 

End With 
© 2018 Microsoft