Table of contents
TOC
Collapse the table of content
Expand the table of content

Shapes.AddConnector Method (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

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

Syntax

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

_expression_A variable that represents a Shapes object.

Parameters

NameRequired/OptionalData TypeDescription
TypeRequiredMsoConnectorTypeThe type of connector to add.
BeginXRequiredVariantThe x-coordinate of the beginning point of the connector.
BeginYRequiredVariantThe y-coordinate of the beginning point of the connector.
EndXRequiredVariantThe x-coordinate of the ending point of the connector.
EndYRequiredVariantThe y-coordinate of the ending point of the connector.

Return Value

Shape

Remarks

For the BeginX, BeginY, EndX, and EndY parameters, 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.

The Type parameter 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.|

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.AddConnector _ 
 (Type:=msoConnectorStraight, _ 
 BeginX:=144, BeginY:=144, _ 
 EndX:=180, EndY:=72)
© 2018 Microsoft