Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Word Labels, No Paragraph Break if Field is Empty

46 views
Skip to first unread message

Jarrett

unread,
May 21, 2018, 3:31:08 PM5/21/18
to

I have been trying to create some labels and some of my fields are
empty.

The fields that may be empty are: 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!




--
Jarrett

Charles K. Kenyon

unread,
May 21, 2018, 3:31:08 PM5/21/18
to

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

Jarrett

unread,
May 21, 2018, 9:31:08 PM5/21/18
to

So considering that I am on a Mac and those commands as far as I know do
not work here, but I will try tomorrow from a Windows, to achieve the
following without paragraph breaks if the field is empty:

<<Company>>
<<Address_1>>
<<Address_2>>
<<Address_3>>
<<Town>> <<Post Code>>
<<County>>
<<Country>>

Is the following correct?

{ Mergefield Company }ś
{ Mergefield Address_1 }{If { Mergefield Address_2 } "" " ś
{ Mergefield Address_2 }"}{If { Mergefield Address_3 } "" " ś
{ Mergefield Address_3 }"}ś
{ Town } { Post Code }ś
{If { County } "" " ś
{ Mergefield County }"}ś
{Country}


Please note that ś is where I pressed Enter or Shift + Enter.




--
Jarrett

Jarrett

unread,
May 23, 2018, 9:31:08 PM5/23/18
to

I managed to do it eventually!

I realised that it is of paramount importance to press Enter and not
Shift+Enter to start a new line (ś), otherwise Word will always leave a
gap between the two lines, even if your formula is correct.

So this is the formula:

{ MERGEFIELD Company }ś
{ MERGEFIELD Address_1 }{If { MERGEFIELD Address_1 } = "" "" " " }ś
{ MERGEFIELD Address_2 }{If { MERGEFIELD Address_2 } = "" "" " " }ś
{ MERGEFIELD Address_3 }{If { MERGEFIELD Address_3 } = "" "" " " }ś
{ MERGEFIELD Address_4 }{If { MERGEFIELD Address_4 } = "" "" " " }ś
{ MERGEFIELD Post Code } { MERGEFIELD Town }ś
{ MERGEFIELD County }{If { MERGEFIELD County } = "" "" " " }ś
{ MERGEFIELD County }ś

I found the right formula by reading this very useful guide:

https://wordmvp.com/FAQs/MailMerge/MMergeIfFields.htm




--
Jarrett
0 new messages