Class ConnectorFormat (Excel VBA)

Contains properties and methods that apply to connectors.

Methods

Other Methods

BeginConnect - Attaches the beginning of the specified connector to a specified shape. If there's already a connection between the beginning of the connector and another shape, that connection is broken.

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

EndConnect - Attaches the end of the specified connector to a specified shape. If there's already a connection between the end of the connector and another shape, that connection is broken.

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

Properties

BeginConnected true if the beginning of the specified connector is connected to a shape.

Set myDocument = Worksheets(1) 
With myDocument.Shapes(3) 
    If .Connector Then 
        With .ConnectorFormat 
            If .BeginConnected Then 
                oldBeginConnSite = .BeginConnectionSite 
                Set oldBeginConnShape = .BeginConnectedShape 
                .BeginDisconnect 
            End If 
        End With 
    End If 
End With

BeginConnectedShape returns a Shape object that represents the shape that the beginning of the specified connector is attached to.

Set myDocument = Worksheets(1) 
With myDocument.Shapes 
 Set r3 = .AddShape(msoShapeRectangle, 450, 190, 200, 100) 
 .AddConnector(msoConnectorCurve, 0, 0, 10, 10).Name = _ 
 "Conn1To3" 
 With .Item("Conn1To2").ConnectorFormat 
 beginConnSite1 = .BeginConnectionSite 
 Set beginConnShape1 = .BeginConnectedShape 
 End With 
 With .Item("Conn1To3").ConnectorFormat 
 .BeginConnect beginConnShape1, beginConnSite1 
 .EndConnect r3, 1 
 End With 
End With

BeginConnectionSite returns an integer that specifies the connection site that the beginning of a connector is connected to.

Set myDocument = Worksheets(1) 
With myDocument.Shapes 
 Set r3 = .AddShape(msoShapeRectangle, 450, 190, 200, 100) 
 .AddConnector(msoConnectorCurve, 0, 0, 10, 10).Name = _ 
 "Conn1To3" 
 With .Item("Conn1To2").ConnectorFormat 
 beginConnSite1 = .BeginConnectionSite 
 Set beginConnShape1 = .BeginConnectedShape 
 End With 
 With .Item("Conn1To3").ConnectorFormat 
 .BeginConnect beginConnShape1, beginConnSite1 
 .EndConnect r3, 1 
 End With 
End With

EndConnected msoTrue if the end of the specified connector is connected to a shape.

Set myDocument = Worksheets(1) 
With myDocument.Shapes(3) 
    If .Connector Then 
        With .ConnectorFormat 
            If .EndConnected Then 
                oldEndConnSite = .EndConnectionSite 
                Set oldEndConnShape = .EndConnectedShape 
                .EndDisconnect 
            End If 
        End With 
    End If 
End With

EndConnectedShape returns a Shape object that represents the shape that the end of the specified connector is attached to.

Set myDocument = Worksheets(1) 
With myDocument.Shapes 
 Set r3 = .AddShape(msoShapeRectangle, _ 
 100, 420, 200, 100) 
 With .Item("Conn1To2").ConnectorFormat 
 endConnSite1 = .EndConnectionSite 
 Set endConnShape1 = .EndConnectedShape 
 End With 
 With .AddConnector(msoConnectorCurve, _ 
 0, 0, 10, 10).ConnectorFormat 
 .BeginConnect r3, 1 
 .EndConnect endConnShape1, endConnSite1 
 End With 
End With

EndConnectionSite returns an integer that specifies the connection site that the end of a connector is connected to.

Set myDocument = Worksheets(1) 
With myDocument.Shapes 
 Set r3 = .AddShape(msoShapeRectangle, _ 
 100, 420, 200, 100) 
 With .Item("Conn1To2").ConnectorFormat 
 endConnSite1 = .EndConnectionSite 
 Set endConnShape1 = .EndConnectedShape 
 End With 
 With .AddConnector(msoConnectorCurve, _ 
 0, 0, 10, 10).ConnectorFormat 
 .BeginConnect r3, 1 
 .EndConnect endConnShape1, endConnSite1 
 End With 
End With

Parent returns the parent object for the specified object. Read-only.

Type returns or sets an MsoConnectorType value that represents the connector format type.