How to Insert an AutoTextList Field in Word Using VBA
Question details
The user wants to write a Word VBA macro that replaces defined terms from a table with an AutoTextList field, using the term as the field value and a corresponding column value as a tooltip.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Automating document formatting by inserting interactive fields via VBA macros.
- Observed behavior
- The user needs to programmatically generate an AutoTextList field where the term appears as text and the definition appears as a hover tooltip.
Ensure that you have enabled the Developer tab in Word to access the VBA editor, and back up your document before running the macro, as programmatic text replacements cannot always be easily undone.
Use the Fields.Add Method in VBA to Create an AutoTextList Field
Programmatically insert the AutoTextList field by targeting the text range and building the field arguments using data from your definitions table.
When working with VBA, the AutoTextList field is highly useful for creating dropdowns or displaying tooltips. To achieve this, you need to use the Fields.Add method and properly escape any quotation marks in both your term and definition strings so the generated field code evaluates correctly.
Press Alt + F11 to launch the Microsoft Visual Basic for Applications window, then insert a new module from the Insert menu.
Write a script to loop through your Definitions table and set a Word.Range object for each term you want to replace in the document.
Build the AutoTextList argument string. Ensure you escape double quotation marks for the term and the definition text (e.g., using Chr(34) or double quotes in the VBA string).
Use the Document.Fields.Add method, passing the target Range and the constructed field text as the Text argument. Set the PreserveFormatting parameter to True.
Run the macro on a sample section of your document first to verify that the generated field codes and tooltips function correctly before applying it globally across the entire document.

Looking for a Lightweight Office Suite with Excellent Document Compatibility?
If you frequently work with complex documents, fields, and automation, WPS Office provides an excellent alternative. It offers a highly familiar interface, reliable native compatibility with Microsoft Word formats, and a seamless editing experience without heavy resource consumption.

Frequently Asked Questions
Why does my AutoTextList field display an error instead of the term?
This usually happens if quotation marks inside the VBA string are not properly escaped. Ensure you use double quotes appropriately or utilize Chr(34) when concatenating your term and definition strings in the VBA macro.
Can I use the AutoTextList field just to show a tooltip without a dropdown?
Yes, by structuring the AutoTextList field arguments without pointing to a valid AutoText category, the field can behave purely as a tooltip mechanism when the user hovers over the text.
Does the VBA Fields.Add method work on multiple tables at once?
The Fields.Add method inserts a field at a single, specific Range object. To process multiple tables, your VBA macro must loop through all tables, then loop through each row to execute Fields.Add sequentially.




