AddConnector Method

Microsoft Publisher Visual Basic

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.

Type   Required MsoConnectorType. The type of connector to add.

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)