How to Fix Word Mail Merge IF/THEN Rule with Multiple Fields
Question details
The user needs to resolve an issue where a Mail Merge IF/THEN rule stops processing after the first merge field or displays raw field codes instead of inserting the intended paragraph with multiple fields.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Setting up a Mail Merge document that uses an IF/THEN condition to output a full paragraph containing several different merge fields.
- Observed behavior
- The IF/THEN rule fails to evaluate completely, stopping at the first nested merge field or displaying field codes instead of the full evaluated text.
Before troubleshooting, press Alt+F9 (Option+F9 on Mac) to toggle your document's field codes, which allows you to view the underlying structure of your IF/THEN rules and spot any manual typing errors.
Reconstruct the IF/THEN Rule Using System Field Braces
Manually typing braces or chevrons causes merge errors. You must use system-generated field braces and properly nest the merge fields inside the condition using Word's interface.
A common cause for Mail Merge conditions breaking is the manual typing of curly braces { } or chevrons << >>. Word relies on hidden code structures to recognize these as dynamic fields, which can only be generated via shortcuts or the ribbon menu.
Highlight and delete the existing IF/THEN rule and any stray merge fields that were placed outside the intended condition block.
Press Ctrl+F9 on your keyboard to insert a new pair of blank field braces { }. Do not type these manually using the keyboard.
Inside the new braces, type your IF statement structure, such as: IF { MERGEFIELD Condition } = "True" " ".
Place your cursor inside the true/false result quotation marks. Go to the Mailings tab, click 'Insert Merge Field', and select the multiple required fields to add them into the paragraph.

Delete and Reinsert Nested Merge Fields
If the rule was created via the IF/THEN dialog but is still failing, refreshing the fields by completely deleting and reinserting them resolves hidden formatting conflicts.
Master Mail Merge with WPS Writer
WPS Writer offers a highly intuitive and robust Mail Merge feature that handles complex IF/THEN rules and multiple nested fields with ease. Creating dynamic conditional documents is straightforward, helping you avoid broken field codes while remaining fully compatible with Word formats.
- 1. Access Mail Merge tools: Open your document in WPS Writer, go to the 'References' or 'Mailings' tab, and select 'Mail Merge' to reveal the dedicated merging toolbar.
- 2. Connect your data source: Click 'Open Data Source' to seamlessly link your Excel spreadsheet, CSV, or database containing the dynamic merge data.
- 3. Insert rules and fields: Use the 'Insert Merge Field' and 'Rules' buttons to safely construct complex conditional paragraphs and IF/THEN statements without ever typing manual field codes.
- 4. Preview and finish: Click 'View Merged Data' to instantly preview your conditional fields. Once satisfied, click 'Merge to New Document' or 'Merge to Printer' to complete the process.

Frequently Asked Questions
Why does my Mail Merge show field codes instead of data?
You likely have field codes toggled on, or you typed the curly braces manually. Press Alt+F9 (or Option+F9 on Mac) to toggle the view. If it still doesn't work, recreate the braces using Ctrl+F9.
Can I put multiple merge fields inside an IF/THEN rule?
Yes, you can include multiple merge fields within the result quotes of an IF statement. However, each nested merge field must be properly inserted using the 'Insert Merge Field' tool rather than typing the field names manually.
What should I do if my IF rule stops evaluating after the first nested field?
This usually indicates a broken field code or corrupted formatting. You should highlight and delete all nested merge fields inside the IF condition, then reinsert them directly through the Mailings toolbar.
Does formatting inside the IF/THEN result apply to the merged document?
Yes, any text formatting (like bold, italics, or specific fonts) applied to the merge fields or standard text inside the IF/THEN quotation marks will successfully carry over to the final merged document.




