Skip to main content

Shape.ConnectorFormat property

Table of contents
  1. Syntax
  2. Example

Returns a ConnectorFormat object that contains connector formatting properties. Applies to a Shape object that represents connectors. Read-only.



expression An expression that returns a Shape object.


This example adds two rectangles to myDocument, attaches them with a connector, automatically reroutes the connector along the shortest path, and then detaches the connector from the rectangles.

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, 0, 0)
With c.ConnectorFormat
    .BeginConnect firstRect, 1
    .EndConnect secondRect, 1
End With

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>