How to Adjust an Elbow Connector in Microsoft Publisher VBA
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.

- 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.
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.
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.
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).
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.
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.

Manually Reroute and Lock the Connector
Bypass complex VBA coding by manually adjusting the connector shape and relying on connection sites to maintain the one-elbow structure.
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. Download and Install: Visit the official WPS Office website to download the free suite and install it on your device.
- 2. Open a Document or Presentation: Launch WPS Writer or WPS Presentation to begin designing your page layout.
- 3. Insert and Adjust Shapes: Navigate to the Insert tab, select Shapes, and easily drag connector handles to format your graphics with precision.

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.




