logo
search
Others

How to Adjust an Elbow Connector in Microsoft Publisher VBA

Aamir Naveed AkramAamir Naveed Akram Sep 30, 2026 870 views

Question details

The user needs to use VBA in Microsoft Publisher to manipulate the adjustment handle of an elbow connector so it routes with one elbow instead of two.

How to Adjust an Elbow Connector in Microsoft Publisher VBA
Product
Microsoft Publisher
Device & OS
not provided
Scenario
Developing a VBA script to dynamically create and format shape layouts involving elbow connectors.
Observed behavior
The Publisher VBA project creates an elbow connector that defaults to two elbows, and there is no obvious property exposed in the basic VBA editor to directly control the yellow adjustment handle.
Before you start

Ensure you have the Developer tab enabled in Microsoft Publisher to access the Visual Basic Editor. Save a backup of your Publisher file and current VBA code before testing new macro adjustments.

Solution 1Recommended

Use the Adjustments Collection in VBA

Access the internal Adjustments collection of the connector shape to programmatically shift the yellow adjustment handle.

While Publisher's object model does not provide a single, named property for 'elbow count', the yellow adjustment handles you see on the canvas are governed by the Shape.Adjustments collection. By tweaking these numerical values, you can alter the connector's geometry.

1
Identify the Connector Shape

Open the VBA Editor (ALT+F11). Assign your newly created elbow connector to a Shape object variable in your code, for example: Dim conn As Shape; Set conn = ActiveDocument.Pages(1).Shapes.AddConnector(msoConnectorElbow, 100, 100, 200, 200).

2
Access the Adjustments Object

Use the Adjustments collection to target the handles. Add a line of code to modify the handle: conn.Adjustments.Item(1) = 0.5. You may need to experiment with values between 0.0 and 1.0 to find the precise coordinate that results in a single elbow.

3
Consult External VBA Communities

If Publisher's specific rendering engine ignores the adjustment parameter, prepare a sample file with your exact geometry and post it in the Stack Overflow VBA community, as Publisher-specific VBA documentation is limited.

Use the Adjustments Collection in VBA
Undocumented Publisher Limitations: Publisher's VBA engine occasionally handles shapes differently than Excel or Word. If the Adjustments property fails, you may need to force a simpler route using BeginConnect and EndConnect methods on closer connection sites.
Free Microsoft Office alternative

Experience Advanced Shape and Document Formatting with WPS Office

If you are struggling with complex layouts and VBA limitations in Microsoft Publisher, consider switching to WPS Office. It provides powerful desktop publishing capabilities through Writer and Presentation, offering highly intuitive shape manipulation without the need to write complex macros.

  1. 1. Download and Install: Visit the official WPS Office website to download the free suite and install it on your device.
  2. 2. Open a Document or Presentation: Launch WPS Writer or WPS Presentation to begin designing your page layout.
  3. 3. Insert and Adjust Shapes: Navigate to the Insert tab, select Shapes, and easily drag connector handles to format your graphics with precision.
Fully compatible with standard Microsoft Office file formats (DOCX, XLSX, PPTX).Intuitive drag-and-drop shape adjustments that bypass the need for complex VBA coding.Lightweight, fast, and runs smoothly on Windows, Mac, and Linux.Free to download and use with premium layout and design templates.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Publisher VBA connector default to two elbows?

Microsoft Publisher automatically routes elbow connectors based on the shortest orthogonal path between two points or connection sites. This default routing engine often generates a two-elbow geometry to prevent the line from crossing over the connected shapes.

Can I record a macro in Microsoft Publisher to find the correct adjustment code?

No, unlike Microsoft Word and Excel, Microsoft Publisher does not include a built-in Macro Recorder. You must write the VBA code manually by referencing the Office object model or finding similar examples from Word/PowerPoint VBA.

How do I access the yellow adjustment handle via VBA code?

You can access these handles using the Shape.Adjustments collection. By modifying a property like Shape.Adjustments.Item(1).Value, you can change the position of the handle, though determining the exact numerical value usually requires trial and error.

Are shape adjustments the same in Publisher as in Excel or Word VBA?

While all Microsoft Office applications share the underlying Office Art drawing engine, Publisher's VBA object model is older and less comprehensive. Some shape properties and adjustment methods available in Excel or PowerPoint may not work correctly in Publisher.