Doug Robbins Mail Merge Field Character Limit Inquiry

Damon Love 0 Reputation points
2026-11-07T17:47:49.82+00:00

What is the character limit for a merge field? I have a field of about 38 characters including spaces in my merge document. However, in the document where I've inserted the merge field, I am seeing the following text: "Error! No document variable supplied."

Please advise.

Thank you.

Microsoft 365 and Office | Word | For home | Windows
0 comments No comments

1 answer

Sort by: Oldest
  1. AI answer

    2026-11-07T17:48:28.4066667+00:00

    The message “Error! No document variable supplied.” indicates that Word is evaluating a DOCVARIABLE field without a valid document variable; replace it with a MERGEFIELD linked to your mail-merge data source if the content is intended to come from that source.

    Check and correct the field

    1. Open the document in Word for Windows desktop.
    2. Press Alt+F9 to display field codes.
    3. Examine the affected field.

    If it resembles:

    { DOCVARIABLE }
    

    or:

    { DOCVARIABLE "Your field name" }
    

    it is a document-variable field, not a mail-merge field. A valid DOCVARIABLE field has the syntax { DOCVARIABLE "Name" } and displays a variable stored inside the document. If that variable has not been supplied, the field cannot produce a result.^1^

    For mail merge, the field should instead resemble:

    { MERGEFIELD "Your 38-character field name" }
    

    The name must exactly match the column heading in the connected data source.^2^

    1. Delete the incorrect field.
    2. Go to Mailings → Select Recipients and connect the correct Excel, CSV, or other mailing list. Word requires the data source to be selected before inserting merge fields.
    3. Place the cursor where the value belongs, then choose Mailings → Insert Merge Field and select the field from the list. Do not type the braces manually.
    4. Select Mailings → Preview Results and move between records to verify that the source value appears.
    5. Press Alt+F9 again if field codes remain visible.

    About the 38-character name

    The official Word documentation supplied here does not specify a general maximum length for native MERGEFIELD names. The documented requirement is that the field name exactly match the header in the selected data source.^2^

    A separate 40-character field-name limit appears in guidance for the third-party Merge Tools Add-in, but that is an add-in requirement and should not be treated as Word’s general mail-merge limit.^3^ In any event, a 38-character name is below that add-in-specific limit.

    If Alt+F9 already shows a correctly formed MERGEFIELD, compare its name—including spaces—with the data-source column heading, then delete and reinsert it through Mailings → Insert Merge Field. Word supports updating a selected field with F9, but reinserting it avoids retaining the wrong field type or an outdated header name.^4^

    If the field genuinely is intended to be a DOCVARIABLE, the document or its VBA automation must create and populate that named variable before the field is updated. Document variables are stored in the document and are distinct from mail-merge columns.^5^


    References

    1. Field codes: DocVariable field
    2. Field codes: MergeField field
    3. Mail merge will not initialize my document - Microsoft Q&A
    4. Insert, edit, and view fields in Word
    5. Variables.Add method (Word)
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.