How to Remove Empty Numbered List Items in a Word Mail Merge
Question details
The user needs to prevent blank paragraphs from appearing in automatically numbered lists when specific mail merge fields contain no data.

- Product
- Word Processing
- Device & OS
- not provided
- Scenario
- Creating a mail merge document where some records have empty fields in an automatically numbered list.
- Observed behavior
- Empty merge fields result in blank numbered paragraphs, breaking the continuity and formatting of the automatic list numbering.
Ensure your data source is correctly linked to your document and identify which specific merge fields are prone to containing blank or empty data.
Use Conditional IF Fields to Suppress Blank Items
By wrapping your merge fields in an IF statement, you can instruct the word processor to only insert the field and its paragraph break if data is actually present.
This method prevents the automatic numbering from advancing when a data field is completely empty. You must use the designated keyboard shortcut to insert the special field code braces; typing normal curly brackets manually will not work.
Press Ctrl+F9 to insert an empty set of field braces { } into your document.
Inside the braces, type the IF condition: IF { MERGEFIELD YourFieldName } <> "" ". Ensure you press Ctrl+F9 again to insert the inner braces for the MERGEFIELD.
Inside the true condition quotes, type the text or insert the field you want to display if it is not empty, followed by a paragraph break (press Enter).
Add the false condition as an empty string "" and close the field. Example: { IF { MERGEFIELD Item1 } <> "" "{ MERGEFIELD Item1 }[Enter]" "" }.
Apply automatic numbering to the resulting fields. Execute the merge to verify, as previewing may not display the final numbering correctly.

Apply \b and \f Switches for Fixed Numbering
Use merge-field switches to add text, fixed numbering, or spacing before or after a field only when it contains data.
Use WPS Writer for Seamless Mail Merge and Document Formatting
WPS Writer offers a highly compatible and intuitive Mail Merge feature. You can easily insert fields, toggle field codes, and manage empty data sources without complex configurations.
- 1. Link Data Source: Open your document in WPS Writer, navigate to the 'Mailings' tab, and click 'Open Data Source' to link your spreadsheet.
- 2. Insert Fields: Use 'Insert Merge Field' to place your data into the document.
- 3. Apply Field Codes: Press Ctrl+F9 to wrap fields in IF statements to manage empty items as described in the solutions.
- 4. Merge to Document: Click 'Merge to New Document' to execute the merge and view perfect automatic numbering.

Frequently Asked Questions
Why does my numbered list show blank lines in the mail merge preview?
The Mail Merge 'Preview Results' feature often does not render automatic numbering and complex field conditions accurately. You must finish and execute the merge to a new document to see the final correct numbering.
Can I just type the curly brackets { } on my keyboard for IF fields?
No, typing standard curly brackets will not work. You must press Ctrl+F9 to insert the special field code braces recognized by the word processor.
What do the \b and \f switches do in a merge field?
The \b switch inserts specified text before the merge field, and the \f switch inserts text after the field, but only if the merge field is not empty. They are useful for adding spacing, punctuation, or manual numbering dynamically.




