Jarrett;497297 Wrote:
> I have been trying to create some labels and some of my fields are
> empty.
>
> The fields that may be empty a Address_2 ; Address_3 ; Address_4 and
> County
>
> This is what my default MailMerge looks like at the moment:
>
> «Title» «Last_Name»
> «Company»
> «Address_1»
> «Address_2»
> «Address_3»
> «Address_4»
> «Town» «Postal_Code»
> «County»
> «Country»
>
>
> PROBLEM:
> If any of the fields are empty, they will leave a space underneath.
>
> Is there any way, maybe with IF conditions or any easier way, to tell
> Word to Skip to the Next Field if that one is empty?
>
> I've been looking on the internet for some time and I have not been able
> to find a solution, any help would be much appreciated!
See the following article about using the IF field.
https://wordmvp.com/FAQs/MailMerge/MMergeIfFields.htm
You will want to have your paragraph marks displayed (Ctrl+Shift+8) when
setting this up. Likely you will also want to have field codes
displayed. (Alt+F9). This may not fit in display of a label. If it does
not, copy the contents of a label into a blank document, do your editing
there and then copy and paste back into the label.
Instead of:
«Company»
«Address_1»
«Address_2»
«Address_3»
«Address_4»
With merge field displayed, you will see:
{ Mergefield Company }
{ Mergefield Address_1 }
{ Mergefield Address_2 }
{ Mergefield Address_3 }
{ Mergefield Address_4 }
(I do not know how to show paragraph marks on this forum, sorry.) I am
assuming that Address_1 will always have data.
You would want something that looks like the following:
{ Mergefield Company }
{ Mergefield Address_1 }{If { Mergefield Address_2 } <> "" "
{ Mergefield Address_2 }"}{If { Mergefield Address_3 } <> "" "
{ Mergefield Address_3 }"}{If { Mergefield Address_4 } <> "" "
{ Mergefield Address_4 }"}
The paragraph mark or line break is inside the quotation marks for the
true result of the IF field.Note, you cannot simply type the braces {}.
Those must be inserted in pairs by Word using Ctrl+F9.
More on the IF field:
http://www.addbalance.com/usersguide/fields.htm#IF_field
--
Charles K. Kenyon