Syntax

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

expression A variable that represents a Shapes object.

Parameters

Name Required/Optional Data Type Description
Type Required The connector type to add.
BeginX Required Single The horizontal position (in points) of the connector's starting point relative to the upper-left corner of the document.
BeginY Required Single The vertical position (in points) of the connector's starting point relative to the upper-left corner of the document.
EndX Required Single The horizontal position (in points) of the connector's end point relative to the upper-left corner of the document.
EndY Required Single The veritcal position (in points) of the connector's end point relative to the upper-left corner of the document.

Return Value
Shape

Remarks

MsoConnectorType can be one of these MsoConnectorType constants.
msoConnectorElbow
msoConnectorTypeMixed
msoConnectorCurve
msoConnectorStraight

When you attach a connector to a shape, the size and position of the connector are automatically adjusted, if necessary. Therefore, if you're going to attach a connector to other shapes, the position and dimensions you specify when adding the connector are irrelevant.

Example

The following example adds a curved connector to a new canvas in a new worksheet.

Visual Basic for Applications
Sub AddCanvasConnector() Dim wksNew As Worksheet Dim shpCanvas As Shape Set wksNew = Worksheets.Add 'Add drawing canvas to new worksheet Set shpCanvas = wksNew.Shapes.AddCanvas( _ Left:=150, Top:=150, Width:=200, Height:=300) 'Add connector to the drawing canvas shpCanvas.CanvasItems.AddConnector _ Type:=msoConnectorStraight, BeginX:=150, _ BeginY:=150, EndX:=200, EndY:=200 End Sub
add connector Add Connector Method AddConnector AddConnector Method Append connector?

See also: