Eliminating blank lines in mail merge if fieldis empty

I am using Word 2013, part of office 365. I have been attempting to create several custom labels. The problem arises when a field is empty and on a line by itself. When I attempt to print the document, a blank line is printed where the field was positioned.


I want Word to ignore blank filed and NOT insert a blank line. I have found several conflicting suggesting for older versions of Word, but none for the 2013 version. I would have thought that Word would have a built in function to accomplish that, but evidently not.

I am open to suggestions. Thanks!
Answer
Answer

We do not know the details of the suggestions to which you are referring.  However, absolutely nothing has changed in respect of Mail Merge.

The way that I usually deal with the situation where you have an Address1, Address2, City, State and Zip fields and there may be no data in the Address2 field is to use the following field construction,

{ MERGEFIELD Address1 }

{ IF { MERGEFIELD Address2 } <> "" "{ MERGEFIELD Address2 }¶
{ MERGEFIELD City }  { MERGEFIELD State } { MERGEFIELD Zip }" "{ MERGEFIELD City }  { MERGEFIELD State } { MERGEFIELD Zip }" }

You must use CTRL+F9 to insert each pair of field delimiters and you use Alt+F9 to toggle off their display.  Where the ¶ appears above, press Enter or Shift+Enter

Alternatively, you can add a \f switch to the field that may be empty, followed by Enter or Shift+Enter in quotes

{ MERGEFIELD Address1 }

{ MERGEFIELD Address2 \f "¶
" }{ MERGEFIELD City }  { MERGEFIELD State } { MERGEFIELD Zip }

The \f switch is used to specified text to be added after the mergefield if the field is not blank.

The reason that I use the former method is that it works with my MergeTools add-in while the \f switch does not.

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

13 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated November 25, 2024 Views 25,516 Applies to: