Suppress Blank Lines in a mail merge

Anonymous
2010-09-17T14:37:31+00:00

Using Word 2007, I am creating a mail merge. Some addresses have one line, some have two (Suite number, etc.) I want to suppress the second address field only if it is blank, so there are no blank lines in the document after I perform the merge. In older versions of Word, I remember a check box for "suppress blank fields" but I can't seem to find that in 2007.

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Suzanne S Barnhill 279.4K Reputation points MVP Volunteer Moderator
2010-09-17T14:59:46+00:00

In general, blank lines are automatically suppressed, but only if they end in a paragraph break, not a line break. Consequently, the default is not a solution for me and perhaps not for you, either. So you have to use an IF field. Assuming your two address lines are the merge fields Address1 and Address2, you'd have something like this.

{ MERGEFIELD Address1 }<line break>

{ IF { MERGEFIELD Address2 } = "" "" "{MERGEFIELD ADDRESS2}<line break>" }

The way that will actually appear in your document is:

{ MERGEFIELD Address1 }

{ IF { MERGEFIELD Address2 } = "" "" "{MERGEFIELD ADDRESS2}

" }

By putting the line break inside the FalseText quotes, you ensure that thereis a line break only if the line contains text; otherwise, there will be no line.

Was this answer helpful?

10+ people found this answer helpful.
0 comments No comments

49 additional answers

Sort by: Newest
  1. Paul Edstein 82,871 Reputation points Volunteer Moderator
    2017-07-12T01:55:12+00:00

    Try moving the line breaks into the fields, thus:

    {IF{MERGEFIELD HBP}= "HBP" "Hawaii Scholarship↵

    "}{IF{MERGEFIELD SCS}= "SCS" "Second Scholarship↵

    "}{IF{MERGEFIELD FYA}= "FYA" "Achievement Grant↵

    "}{IF{MERGEFIELD FPG}= "FPG" "Special Grant"}

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2017-07-12T01:33:11+00:00

    Hi 

    I'm working on a table in word with merge fields and it keeps inserting a line break whenever the field is empty. 

    { IF { MERGEFIELD HBP } = "HBP" "Hawaii Scholarship" <line break>

    { IF { MERGEFIELD SCS } = "SCS" "Second Scholarship" <line break>

    { IF { MERGEFIELD FYA } = "FYA" "Achievement Grant" <line break>

    { IF { MERGEFIELD FPG } = "FPG" "Sepecial Grant" <line break>

    When I merge it and one of the values is blank (e.g. SCS) it still inserts a line break

    E.g. 

    Hawaii Scholarship

    Achievement Grant

    Special Grant 

    I'm not sure how to fix this can you help me?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-09-22T18:30:46+00:00

    HERE IS HOW YOU DO IT .... in 2010

    It's amazing some of you "masters of the program" missed this one...

    1. Right Click the code that represents the field that you want to collapse when blank
    2. Click "Edit Field"
    3. Click "Field Codes"

    4 Click "Options"

    1. Click "Field Specific Switches" tab

    6 Click " \F"

    1. Click OK then OK

    Proceed with the rest of the mail merge process....

    www.brightinsight.com

    This is the one that worked for me in Office 2016. Except you need to click "Add Code" between steps 6 & 7, and be sure your merge field lines are followed by hard returns, not soft ones.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2016-09-22T18:23:52+00:00

    Your solution was perfect for MS Word 2010. Thank you!

    This worked for me in Office 2016, but one step missing is to click Add Code before clicking okay and okay. Also, be sure your merge fields are followed by hard returns, no soft ones.

    Was this answer helpful?

    0 comments No comments