Share via


Shapes.AddConnector Method

Creates a connector. Returns a Shape object that represents the new connector.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function AddConnector ( _
    Type As MsoConnectorType, _
    BeginX As Single, _
    BeginY As Single, _
    EndX As Single, _
    EndY As Single _
) As Shape
'Usage
Dim instance As Shapes
Dim Type As MsoConnectorType
Dim BeginX As Single
Dim BeginY As Single
Dim EndX As Single
Dim EndY As Single
Dim returnValue As Shape

returnValue = instance.AddConnector(Type, _
    BeginX, BeginY, EndX, EndY)
Shape AddConnector(
    MsoConnectorType Type,
    float BeginX,
    float BeginY,
    float EndX,
    float EndY
)

Parameters

  • BeginX
    Type: System.Single

    Required Single. The horizontal position (in points) of the connector's starting point relative to the upper-left corner of the document.

  • BeginY
    Type: System.Single

    Required Single. The vertical position (in points) of the connector's starting point relative to the upper-left corner of the document.

  • EndX
    Type: System.Single

    Required Single. The horizontal position (in points) of the connector's end point relative to the upper-left corner of the document.

  • EndY
    Type: System.Single

    Required Single. The veritcal position (in points) of the connector's end point relative to the upper-left corner of the document.

Return Value

Type: Microsoft.Office.Interop.Excel.Shape

Remarks

When a connector is added, it's not connected to anything. Use the BeginConnect and EndConnect methods to attach the beginning and end of a connector to other shapes in the document.

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.

See Also

Reference

Shapes Interface

Shapes Members

Microsoft.Office.Interop.Excel Namespace