Share via


AddConnector Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.  

Adds a new Shape object representing a connector to the specified Shapes collection.

expression.AddConnector(Type, BeginX, BeginY, EndX, EndY)

expression   Required. An expression that returns one of the objects in the Applies To list.

MsoConnectorType

MsoConnectorType can be one of these MsoConnectorType constants.
msoConnectorCurve  Adds a curved connector.
msoConnectorElbow  Adds an elbow-shaped connector.
msoConnectorStraight  Adds a straight-line connector.
msoConnectorTypeMixed  Not used with this method.

BeginX  Required Variant. The x-coordinate of the beginning point of the connector.

BeginY  Required Variant. The y-coordinate of the beginning point of the connector.

EndX  Required Variant. The x-coordinate of the ending point of the connector.

EndY  Required Variant. The y-coordinate of the ending point of the connector.

Remarks

For the BeginX, BeginY, EndX, and EndY arguments, numeric values are evaluated in points; strings can be in any units supported by Microsoft Publisher (for example, "2.5 in").

The new connector isn't connected to any other shape; use the BeginConnect and EndConnect methods to connect the new connector to another shape.

Example

The following example adds a new straight-line connector to the first page of the active publication.

  Dim shpConnect As Shape

Set shpConnect = ActiveDocument.Pages(1).Shapes.AddC onnector _
    (Type:=msoConnectorStraight, _
    BeginX:=144, BeginY:=144, _
    EndX:=180, EndY:=72)