none
Office 2010 Don't print blank lines when data fields are empty

    Question

  • How do you do this in office 2010?  Where do we go now?

    This used to be under the Tools menu in previous versions:

    1. On the Tools menu, click Mail Merge.
    2. In the Mail Merge Helper dialog box, click Merge.

      NOTE: You must select the main document and data source for the merge before doing step 2.
    3. In the Merge dialog box, under When Merging Records, click either:
      • Don't print blank lines when data fields are empty.

        -or-
      • Print blank lines when data fields are empty.
    4. Click Close in the Merge dialog box, and then click Close in the Mail Merge Helper.

      NOTE: If you made no changes in the Merge dialog box, the Close button is not available. Click Cancel instead.
    Monday, August 16, 2010 9:54 PM

All replies

  • Hi,

     

    In Word 2007 or Word 2010, you can add Mail Merge Helper to the Quick Access bar, and perform the steps then.  

     

    To add the Mail Merge Helper command in the Quick Access Toolbar in Word 2007, follow these steps:

    a.                  In Word 2007, click the Microsoft Office Button, and then click Word Options > Customize.

                  In Word 2010, click File > Options > Customize Ribbon.

    b.                  Click All Commands in the Choose commands from, and then click Mail Merger Helper in the Choose commands from list.

    c.                   Click Add, and then OK.

     

    Best Regards,

     

    Sally Tang

    • Marked as answer by Sally Tang Thursday, August 26, 2010 8:36 AM
    • Unmarked as answer by dtownlake Thursday, August 26, 2010 2:59 PM
    Wednesday, August 18, 2010 5:48 AM
  • This is great, except it doesn't work.

    You are right, you can add the mail Mail Merger Helper, and it clearly says there to Suppress Blank Lines in Address, but it doesn't suppress them.

    Thursday, August 26, 2010 3:01 PM
  • yes, indeed, it does not work. Any update on how to accomplish suppressing blank lines?
    Friday, February 25, 2011 3:35 PM
  • This works for 2010:

    Click on "Replace" (as in Find/Replace)
    Click on "More >>" (to open up the lower options, if it is already open you will see the button "<<Less")
    Place the cursor in "Find What"
    Click on "Special"
    Select "Manual Line Break" - IMPORTANT, do this twice!

    Place the cursor in "Replace With"
    Click on "Special"
    Select "Manual Line Break" - but this time only once

    Run the "Replace All"

    NOTE:  If you have some addresses where there were more than one consecutive blank line, simply run the Replace All again (each time it will be removing just one blank line).

    DONE!

    Monday, April 18, 2011 10:39 AM
  • Hi dtownlake,

    There are two mergefield switches you can use for this:
    \b - Specifies the text to be inserted before the MERGEFIELD field if the field is not blank.
    \f - Specifies the text to be inserted following the MERGEFIELD field if the field is not blank.

    For example, suppose your mergefield is «Data». Selecting the field and pressing Shift F9 will reveal:
    {MERGEFIELD Data}
    If you code the mergefield as:
    {MERGEFIELD Data \b "¶
    "}
    (where ¶ is a pargraph break) it will insert a paragraph break before the mergefield if the field is not blank. Conversely, if you code the mergefield as:
    {MERGEFIELD Data \f "¶
    "}
    it will insert the paragraph break after the mergefield if the field is not blank.

    So, where you have, say, three address lines, the second of which is often empty, instead of having:
    «Title» «FirstName» «LastName»
    «CompanyName»
    «Address1»
    «Address2»
    «City», «State» «Zip»
    you might add the \b switch to the «Address2» field and lay the fields out as:
    «Title» «FirstName» «LastName»
    «CompanyName»
    «Address1»«Address2»
    «City», «State» «Zip»


    Cheers
    Paul Edstein
    [MS MVP - Word]
    • Proposed as answer by macropodMVP Thursday, October 06, 2011 3:28 AM
    Monday, April 18, 2011 11:21 AM
  • THat's a great switch, I tried it and it worked great for the address1/address2 problem. 

    Do you know of a similar fix for a spacing problem?  I'm dealing with names.  I'm working with data where there are first and last names, spouse first and last names, job titles and business names. 

    Where there is no middle initial or spouse name, word is leaving the spaces there.  I've already got if/else statements in there to deal with spouses (eg. if spouse name is not blank, insert "&", or if job title is not blank, insert ",") so I'm not sure about how to do the proper syntax to suppress blank spaces when any or several of these fields are blank. 

    Friday, August 19, 2011 4:18 PM
  • With the switches, you can use whatever you want for the conditional output (eg {MERGEFIELD SpouseName \b " & "}


    Cheers
    Paul Edstein
    [MS MVP - Word]
    Saturday, August 20, 2011 5:20 AM
  • I'm sorry but this is a bunch of crap.  I really appreciate you forum people posting help like this, and I am trying to work through this and eventually am confident that it will work.  But HOW THE HELL is a "normal" user supposed to figure this out.  An address mail merge has to be one of the biggest uses of Word.  A simple thing like suppressing blank lines and I have to go through all this crap?!?  Ridiculous.
    Tuesday, October 04, 2011 7:06 PM
  • Perhaps you'd prefer the solution that doesn't use the field switches?

    {IF{MERGEFIELD Data}<> "" "{MERGEFIELD Data}¶
    "}}

    A simple field switch does away with all that extra coding.


    Cheers
    Paul Edstein
    [MS MVP - Word]
    Thursday, October 06, 2011 3:27 AM
  • I feel dumb asking, but where is the symbol for the paragraph break or how do I put that in? It's not on the keyboard and I can't find it in Insert. Thanks.
    Tuesday, November 08, 2011 3:54 PM
  • I feel dumb asking, but where is the symbol for the paragraph break or how do I put that in? It's not on the keyboard and I can't find it in Insert. Thanks.

    You don't input the symbol, per se. rather, you simply press Enter where that symbol has been indicated in my previous post(s)
    Cheers
    Paul Edstein
    [MS MVP - Word]
    Sunday, November 13, 2011 7:41 AM
  • That sounds like a great fix, but there's no "More>>" in the "Replace" option that i can see in Publisher 2010 or 2007. No way to click on "Special." More clues?
    Sunday, March 04, 2012 8:56 PM
  • That sounds like a great fix, but there's no "More>>" in the "Replace" option that i can see in Publisher 2010 or 2007. No way to click on "Special." More clues?
    The solutions I posted are for Word, not Publisher. This is a Word forum, after all. I don't use Publisher, so I can't advise you on how to achieve the same result with that app.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Sunday, March 04, 2012 9:33 PM
  • When I press Enter, it assumes I'm finished with the dialogue box and closes without including the hard return formating I'm looking to accomplish.
    Thursday, March 15, 2012 3:57 PM
  • That is not how to add the returns. Please re-read my post of 18 April 2011.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Thursday, March 15, 2012 9:14 PM
  • THANK YOU, thank you, thank you!

    I finally understand how to do it!


    Thursday, April 26, 2012 12:44 PM
  • Hi, I am sorry to bug, but I can't find that post and I have the same issue?  Can you explain how to get the returns in?

    Wednesday, February 27, 2013 7:14 PM
  • Hi, I am sorry to bug, but I can't find that post and I have the same issue?  Can you explain how to get the returns in?


    It's the first post I made in this thread...

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Wednesday, February 27, 2013 10:18 PM
  • Hello, How can I remove a blank TABLE ROW in Word 2007? Thank you.
    Wednesday, May 08, 2013 11:07 PM
  • Basically, you can't. Your posts suggests, though that you're working with data that can output variable row counts. You can use Word's Catalogue/Directory Mailmerge facility for this (the terminology depends on the Word version). To see how to do so with any mailmerge data source supported by Word, check out my Microsoft Word Catalogue/Directory Mailmerge Tutorial at:
    http://windowssecrets.com/forums/showthread.php/111149-Mailmerge-Tutorial-Create-Sorted-Listings-(2000-2010)
    or
    http://www.gmayor.com/Zips/Catalogue%20Mailmerge.zip

    The tutorial covers everything from list creation to the insertion & calculation of values in multi-record tables in letters. Do read the tutorial before trying to use the mailmerge document included with it. 

    For some worked examples, see the attachments to the posts at:
     
    Alternatively, you may want to try one of the Many-to-One Mail Merge add-ins, from:

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Thursday, May 09, 2013 12:09 AM
  • I'm sorry but this is a bunch of crap.  I really appreciate you forum people posting help like this, and I am trying to work through this and eventually am confident that it will work.  But HOW THE HELL is a "normal" user supposed to figure this out.  An address mail merge has to be one of the biggest uses of Word.  A simple thing like suppressing blank lines and I have to go through all this crap?!?  Ridiculous.

    Yes I totally agree! What was wrong with the old method which worked perfectly and was very easy to use - tick a box to ignore blank lines? This is so overly complicated! I keep an old template letter which I copy over and which was originally created in Word XP I think and amend the letter text but it seems crazy to have to do this when the old mailmerge method was so much better.
    Tuesday, June 18, 2013 12:11 PM
  • I'm replying 3 years later, but after spending an hour on this, I figured it out. I tried to do all the things in this thread in adding the switch, but couldn't figure out how to enter the paragraph break (tried enter, shift-enter, enter in quotes, shift-enter in quotes). My initial try with the Mail Merge Helper didn't work either.

    Not sure why, but this is what happened. I used the Mail Merge Helper, so the "suppress blank lines" feature was in affect.

    DIDN'T WORK: While I was setting up my fields, I was pressing shift-enter between the fields to get them nice and close on the labels.

    WORKED: While I was setting up my fields, I just pressed enter between the fields. Then later, I selected "all", went to Paragraph, and formatted them as single line spacing with "0" in both the "before" and "after" fields.

    Somehow, this affected the Mail Merge Helper working. Don't ask me why, but this solved my problem.


    • Edited by evpfoot Friday, August 16, 2013 5:32 PM
    Friday, August 16, 2013 5:31 PM
  • In Word 2010 there is no need to write any fancy programming or even to invoke Mail Merge Helper if you want to suppress blank lines in a mail merge.

    All you have to do, for example, is put «Address2» on a line all by itself (with no spaces or punctuation added) and then hit "Enter" (no shift).

    That's it! Yes, really.


    • Edited by Voyager407 Tuesday, December 17, 2013 2:03 AM
    • Proposed as answer by Voyager407 Tuesday, December 17, 2013 9:55 PM
    Tuesday, December 17, 2013 2:00 AM
  • All you have to do, for example, is put «Address2» on a line all by itself (with no spaces or punctuation added) and then hit "Enter" (no shift).


    If that really was all it took, why do you suppose people who had done just that found otherwise?

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Tuesday, December 17, 2013 5:53 AM

  • If that really was all it took, why do you suppose people who had done just that found otherwise?


    I strongly suspect that they have a wayward space or punctuation mark somewhere on the line and don't notice it (or don't realize the result it will have).

    It works every time for me. Have you tried it?

    Tuesday, December 17, 2013 9:54 PM
  • I just tested using the address block (which I never use). It has six lines including two address lines. Since the 2nd one meets the criteria I mentioned (actually all lines are OK), it doesn't leave a blank line when there is no data for it. 

    If blank lines are suppressed automatically when using the address block, then there should be no problem with a line like this one:

    «Address2»¶

    The paragraph symbol, of course, is not to be typed. Just hit ENTER.

    Tuesday, December 17, 2013 10:18 PM
  • Yes, I have tried it and it is not reliable. That's precisely why there are other proven, reliable methods such as using field switches and IF fields.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Tuesday, December 17, 2013 10:37 PM

  • I am very acquainted with IF fields and, in fact, have another document, that I use to create a directory, that has lines in it that are so long and complicated (embedded IF) that I can only read all of the code (after hitting Alt-F9) if I temporarily change it to a much smaller font and then enlarge the view setting.

    In the case of suppressing blank lines in a simple address list, however, the easy way I have described has never failed me. I guess we all do whatever works best for us. 

    Wednesday, December 18, 2013 4:12 PM
  • I fail to see how your solution is less complicated than adding a field
    switch. Amongst other things, it doesn't work unless each line is a separate paragraph, which compromises any Style-based document formatting such as space before/after, indents, etc, all of which increase the difficulty of maintaining the document and can lead to document instability.

    Cheers
    Paul Edstein
    [MS MVP - Word]


    • Edited by macropodMVP Tuesday, December 24, 2013 4:26 AM
    Tuesday, December 24, 2013 4:26 AM
  • I have a slightly different problem: I am using a mergefield for e-mail addresses with "e: " as the text to be inserted before the contents. However when the email address is too long for the line, word is putting a line break in but this is after "e:" which is left behind.  Is there a way I can force Word to keep the "e: " text and the mergefield contents together when it needs to insert a line break?

    Cheers

    Saturday, January 04, 2014 2:50 PM
  • That's quite a different issue, for which the solution is to insert a non-breaking space (i.e. Ctrl-Shift-Space) after the 'e:'.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Saturday, January 04, 2014 9:07 PM
  • I know this is an old post but for those looking today:

    remove spaces between your fields then add an \f " " 

    this will add a space if the field is not blank. if the field is blank you will automatically have no spaces.

    Thursday, January 09, 2014 11:01 PM
  • I know this is an old post but for those looking today:

    remove spaces between your fields then add an \f " " 

    this will add a space if the field is not blank. if the field is blank you will automatically have no spaces.


    The use of the \f switch has been covered before ... and using a space within it cannot be used to suppress blank lines, which is what this thread is about.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Thursday, January 09, 2014 11:32 PM
  • Many thanks Paul
    Monday, January 13, 2014 10:13 PM
  • Please can someone help I cannot overcome a spacing problem.  I understand the switches but cannot seem to get them to work.  I am trying to produce some labels based on

    Title, Forename, Surname,

    Department 

    Company.

    Not everyone has a title therefore when I insert the fields and do the mail merge for those without a title I am getting a blank and therefore their name is not left aligned with the rest of the data.  Please can you advise which switch I use to ignore this field if blank.

    Thanks

    Tuesday, January 14, 2014 10:53 AM
  • With your Title mergefield:
    • delete the space after it;
    • press Alt-F9 to expose the field code, which should look like {MERGEFIELD Title};
    • edit the field code so it look like {MERGEFIELD Title \f " "};
    • press F9 to update the field;
    • Finish the merge


    Cheers
    Paul Edstein
    [MS MVP - Word]


    • Edited by macropodMVP Wednesday, January 15, 2014 7:01 AM
    Wednesday, January 15, 2014 7:00 AM