Syntax

expression.BeginConnect(ConnectedShape, ConnectionSite)

expression A variable that represents a ConnectorFormat object.

Parameters

Name Required/Optional Data Type Description
ConnectedShape Required Shape The shape to attach the beginning of the connector to. The specified object must be in the same collection as the connector.
ConnectionSite Required Long A connection site on the shape specified by ConnectedShape. Must be an integer between 1 and the integer returned by the property of the specified shape. If you want the connector to automatically find the shortest path between the two shapes it connects, specify any valid integer for this argument and then use the method after the connector is attached to shapes at both ends.

Remarks

When you attach a connector to an object, the size and position of the connector are automatically adjusted, if necessary.

Example

This example adds two rectangles to myDocument and connects them with a curved connector. Notice that the RerouteConnections method makes it irrelevant what values you supply for the ConnectionSite arguments used with the BeginConnect and EndConnect methods.

Visual Basic for Applications
Set myDocument = Worksheets(1) Set s = myDocument.Shapes Set firstRect = s.AddShape(msoShapeRectangle, 100, 50, 200, 100) Set secondRect = s.AddShape(msoShapeRectangle, 300, 300, 200, 100) Set c = s.AddConnector(msoConnectorCurve, 0, 0, 100, 100) with c.ConnectorFormat .BeginConnect ConnectedShape:=firstRect, ConnectionSite:=1 .EndConnect ConnectedShape:=secondRect, ConnectionSite:=1 c.RerouteConnections End With
Attach the beginning of a specified connector to a shape? begin begin connect Begin Connect Method BeginConnect BeginConnect Method Hook up connector? Reconnect the front end of a connector to a different shape?

See also: