logo
search
Printing Problems

How to Prevent Blank Lines in Word Mail Merge Labels

WPS EditorWPS Editor Oct 9, 2026 869 views

Question details

The user wants to prevent empty lines on printed address labels when certain optional database fields are blank during a mail merge.

How to Prevent Blank Lines in Word Mail Merge Labels
Product
Microsoft Word 365
Device & OS
Windows 10
Scenario
Printing address labels using mail merge with an Excel database that contains some empty fields.
Observed behavior
Blank fields leave unwanted empty lines on the printed labels because the paragraph mark following the field is still processed.
Before you start

Identify the exact names of the optional fields in your Excel database (e.g., Address_Line_2) and ensure your data source is correctly linked to your Word document.

Solution 1Recommended

Use IF Field Codes to Suppress Blank Lines

Use a conditional IF field to include the paragraph mark only when the specific merge field contains data.

The empty line is usually not caused by the blank merge field itself, but by the paragraph mark (Enter key) placed after it. By using an IF field, you can tell Word to only insert that paragraph mark if the field has text.

1
Display Field Codes

Open your Word mail merge document and press Alt+F9 (or Alt+Fn+F9 on some laptops) to reveal the hidden field codes.

2
Locate the Optional Field

Find the merge field that might be empty, such as { MERGEFIELD Address_Line_2 }, and highlight both the field and the paragraph mark immediately following it.

3
Insert the IF Condition

Replace the highlighted section with an IF statement using this syntax: { IF { MERGEFIELD "Address_Line_2" } <> "" "{ MERGEFIELD Address_Line_2 }[Press Enter here]" "" }.

4
Repeat for Other Fields

Apply this same conditional construction to any other optional fields in your label layout. Fields that always contain data do not require an IF field.

5
Hide Field Codes and Preview

Press Alt+F9 again to hide the field codes. Click 'Preview Results' on the Mailings tab to verify that the blank lines are successfully suppressed.

Use IF Field Codes to Suppress Blank Lines
Inserting Field Braces: Do not type the curly braces {} manually on your keyboard. You must press Ctrl+F9 to insert valid field code braces.
WPS Mail Merge

Easily Create Labels and Suppress Blank Lines with WPS Office

WPS Writer offers a comprehensive Mail Merge feature that fully supports Excel data sources and advanced field codes. You can easily set up conditional fields to ensure your printed labels look professional without empty lines.

  1. 1. Open Mail Merge: Launch WPS Writer, navigate to the 'References' tab, and click 'Mail Merge'.
  2. 2. Link Data Source: Click 'Open Data Source' to connect your Excel address database to the document.
  3. 3. Insert Fields: Insert your necessary merge fields into the label layout.
  4. 4. Apply Conditional Codes: Press Alt+F9 to toggle field codes and use Ctrl+F9 to insert IF conditions to handle your blank fields.
  5. 5. Merge and Print: Click 'Merge to Printer' to print your perfectly formatted labels without unwanted spaces.
Fully compatible with Microsoft Word and Excel file formats (.docx, .xlsx)Supports advanced Mail Merge rules and field codes like IF statementsFree, lightweight, and features a familiar user interfaceBuilt-in PDF conversion for easy label sharing and printing
microsoft office alternative - wps office

Frequently Asked Questions

Why does a blank merge field create an empty line?

The empty line is usually caused by the paragraph mark (created when you press Enter) placed directly after the merge field. Even if the field is blank, the paragraph mark remains and forces a new line on the label.

How do I type the curly brackets for field codes?

You cannot type the curly braces {} using your keyboard to create field codes. You must press Ctrl+F9 (or Ctrl+Fn+F9 on some laptops) to insert a functional field code bracket pair.

Can I automatically skip blank records instead of just blank fields?

Yes. Under the Mailings tab, click 'Edit Recipient List'. You can use the filter options to exclude rows that are completely blank or missing essential data before running the merge.

Why aren't my field codes updating when I switch them off?

After toggling field codes off by pressing Alt+F9, the display may not update instantly. Click the 'Preview Results' button on the Mailings tab or press F9 to refresh the fields and view the final layout.