logo
search
VBA & Macro Problems

How to Create an Address Drop-Down in a Word Document Header

Elise WilliamsElise Williams Oct 23, 2026 869 views

Question details

The user wants to create a drop-down menu in a Word document header containing about 40 different office locations, which inserts the corresponding multi-line formatted address when selected.

How to Create an Address Drop-Down in a Word Document Header
Product
Word
Device & OS
not provided
Scenario
Creating standardized corporate letterheads or templates that require users to select and automatically insert specific multi-line office addresses.
Observed behavior
The user needs a practical way to store and select from 40 different multi-line addresses, overcoming the item limits and formatting challenges of standard drop-down lists in headers.
Before you start

Before proceeding, ensure that the Developer tab is enabled in your Word ribbon, as you will need it to access VBA editors, UserForms, and advanced form controls.

Solution 1Recommended

Use a VBA UserForm to Insert Addresses

Create a custom VBA UserForm with a combo box that allows users to select an office location, keeping the interface user-friendly and out of the restricted header space.

Placing a drop-down control directly inside a header can cause formatting and user-experience issues, and legacy drop-downs have a 25-item limit. Instead, a VBA UserForm can prompt the user to select from 40+ office locations when the document opens, and then automatically inject the correct multi-line address into a predefined bookmark in the header.

1
Enable the Developer Tab

Go to File > Options > Customize Ribbon. Check the box for 'Developer' in the right pane and click OK.

2
Open the VBA Editor

Click 'Visual Basic' on the Developer tab to open the VBA editor.

3
Create a UserForm

Right-click your document project in the Project Explorer, select Insert > UserForm. Use the Toolbox to add a ComboBox and a CommandButton to the form.

4
Populate the List

Double-click the UserForm and write a VBA initialization script to populate the ComboBox with your 40 office addresses. For easier maintenance, write a script to pull these dynamically from an external Excel workbook.

5
Link to the Document Header

Add an execution script to the CommandButton that takes the selected ComboBox value and writes it to a specific bookmark located inside your document's header.

Use a VBA UserForm to Insert Addresses
Excel Integration Advantage: Storing the 40+ addresses in a separate Excel workbook and using VBA to read them into the Word UserForm makes it incredibly easy to update or add locations in the future without editing the Word template.
Manage Document Templates Efficiently

Create Standardized Templates Easily in WPS Writer

WPS Office offers a robust Developer tab and seamless AutoText (Quick Parts) features, allowing you to create drop-downs, insert automated addresses, and manage corporate templates with ease.

  1. 1. Open WPS Writer: Launch WPS Writer and open your letterhead or corporate template.
  2. 2. Enable Developer Tools: Go to Menu > Options > Customize Ribbon to ensure the Developer tab is visible for advanced form controls.
  3. 3. Insert Form Fields: Navigate to the Developer tab, click 'Drop-Down Form Field', and double-click the inserted field to add your office locations.
  4. 4. Utilize AutoText: Alternatively, highlight a typed address, go to Insert > Quick Parts, and save it to your gallery for instant insertion into any header.
Fully compatible with Microsoft Word .docx formats and templatesSupports advanced Developer tools, VBA macros, and form controlsBuilt-in Quick Parts for easy multi-line text insertionLightweight application with a familiar, user-friendly interface
microsoft office alternative - wps office

Frequently Asked Questions

Why is placing a drop-down list directly in the header problematic?

Placing form controls directly in the header requires users to double-click and access the restricted header space just to make a selection, which is unintuitive. It can also cause unwanted formatting and margin shifts if the multi-line text expands unexpectedly.

Can I populate a Word drop-down list directly from an Excel file?

Yes, by using a VBA UserForm. You can write a macro that connects to an external Excel workbook, reads the list of addresses, and populates the ComboBox in your Word document dynamically upon opening.

Is there a limit to how many items a Word drop-down list can hold?

Legacy drop-down form fields in Word are strictly limited to 25 items. If you have 40 office locations, you must use a Content Control drop-down, an ActiveX ComboBox, or a VBA UserForm to accommodate the larger list.

Will my VBA macro work if I send the document to someone else?

The macro will only work if the recipient saves the document as a Macro-Enabled Document (.docm) and explicitly enables macros in their security settings when they open the file.