• Word Labels, No Paragraph Break if Field is Empty

    From Jarrett@21:1/5 to All on Mon May 21 18:49:41 2018
    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
    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Charles K. Kenyon @21:1/5 to All on Mon May 21 19:58:56 2018
    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
    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jarrett@21:1/5 to All on Mon May 21 20:43:46 2018
    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
    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jarrett@21:1/5 to All on Wed May 23 23:06:01 2018
    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
    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)