FAQ: How to suppress blank merge fields
Posted April 21, 2021
A common request for mail merges is the need to suppress merge fields when they contain no data.
Example: If you have a label mail merge that is used for creating mailing labels and the Address Line 2 and Address Line 3 merge fields are blank for most but not all of the records, you would want to suppress the merge fields when they contain no data so that there is not two extra blank lines between the Address Line and the City, State, Zip line.
The following method can be used in Microsoft Word to suppress the merge fields when they contain no data:
- Toggle the field codes in the mail merge document so that merge fields present in the following manner (Alt+F9 can accomplish this): {MERGEFIELD *Field_name*}
- Remove any carriage returns and spaces between the merge field that you want to be suppressed if it is blank and the previous merge field.
- Insert the following text within the merge field at the closing bracket:
\b "
"
Example:
Original template:
{MERGEFIELD AddressAddress}
{MERGEFIELD AddressAddress2}
{MERGEFIELD AddressAddress3}
{MERGEFIELD AddressCity}, {MERGEFIELD AddressState}, {MERGEFIELD AddressZip}
Updated template with blank merge field suppression:
{MERGEFIELD AddressAddress}{MERGEFIELD AddressAddress2 \b "
"}{MERGEFIELD AddressAddress3 \b "
"}
{MERGEFIELD AddressCity}, {MERGEFIELD AddressState}, {MERGEFIELD AddressZip}
Related articles
More from the Knowledge Base
Still have questions?
Live chat is staffed weekdays 8 am to 7 pm ET. Tickets get a response within one business day.
New to PCR Educator?
If you landed here from a search and want to see what PCR Educator can do, the demo is the fastest way in. Thirty minutes, no commitment.