編輯

共用方式為


ConnectorFormat Interface

Definition

Contains properties and methods that apply to connectors.

public interface class ConnectorFormat
[System.Runtime.InteropServices.Guid("0002443E-0000-0000-C000-000000000046")]
[System.Runtime.InteropServices.InterfaceType(2)]
public interface ConnectorFormat
Public Interface ConnectorFormat
Attributes

Remarks

A connector is a line that attaches two other shapes at points called connection sites. If you rearrange shapes that are connected, the geometry of the connector will be automatically adjusted so that the shapes remain connected.

Use the ConnectorFormat property to return a ConnectorFormat object. Use the BeginConnect(Shape, Int32) and EndConnect(Shape, Int32) methods to attach the ends of the connector to other shapes in the document. Use the RerouteConnections() method to automatically find the shortest path between the two shapes connected by the connector. Use the Connector property to see whether a shape is a connector.

Note that you assign a size and a position when you add a connector to the Shapes collection, but the size and position are automatically adjusted when you attach the beginning and end of the connector to other shapes in the collection. Therefore, if you intend to attach a connector to other shapes, the initial size and position you specify are irrelevant. Likewise, you specify which connection sites on a shape to attach the connector to when you attach the connector, but using the RerouteConnections method after the connector is attached may change which connection sites the connector attaches to, making your original choice of connection sites irrelevant.

Connection sites are generally numbered according to the rules presented in the following table.

AutoShapes, WordArt, pictures, and OLE objectsThe connection sites are numbered starting at the top and proceeding counterclockwise.
FreeformsThe connection sites are the vertices, and they correspond to the vertex numbers.

Properties

Application

Returns an Application object that represents the Microsoft Excel application.

BeginConnected

True if the beginning of the specified connector is connected to a shape.

BeginConnectedShape

Returns a Shape object that represents the shape that the beginning of the specified connector is attached to.

BeginConnectionSite

Returns an integer that specifies the connection site that the end of a connector is connected to.

Creator

Returns a 32-bit integer that indicates the application in which this object was created.

EndConnected

msoTrue if the end of the specified connector is connected to a shape.

EndConnectedShape

Returns a Shape object that represents the shape that the end of the specified connector is attached to.

EndConnectionSite

Returns an integer that specifies the connection site that the end of a connector is connected to.

Parent

Returns the parent object for the specified object.

Type

Returns or sets the connector format type.

Methods

BeginConnect(Shape, Int32)

Attaches the beginning of the specified connector to a specified shape.

BeginDisconnect()

Detaches the beginning of the specified connector from the shape it’s attached to.

EndConnect(Shape, Int32)

Attaches the end of the specified connector to a specified shape.

EndDisconnect()

Detaches the end of the specified connector from the shape it’s attached to.

Applies to