Forum Discussion

Tony2021's avatar
Tony2021
Steel Contributor
Feb 28, 2022

Mail Merge and IF ""

Hello,

I am a novice user and dont have much experience with mail merge. 

I have poked around on the internet for how to use the IF in mail merge.

 

What I want to do:

Hide a field and the related text if the field it is blank.

 

Below is what I have and in preview results it does seem to hide if SWIFT is "" but when I unclick the preview results I no longer see the fields there.  They are completely gone and I dont know how to bring it back.  

{ IF «SWIFT» <>"" SWIFT: «SWIFT» }

How do I bring back the fields?  

 

I also need to remove that row completely IF "" and think I might need to add /b possibly? I also read that there could be a conflict with \b and IF so I am not sure about how to remove the line completely so there are no blank rows

 

Note: I have read that you have to follow certain steps and can not type in teh chevrons or the brackets (must hit Control F9 to wrap in brackets).  For the <> I am simply typing it in and assume that is the way to do it. 

 

 

Grateful for the help. 

  • Tony2021 The field construction that you are using is NOT the same as the one in my response

     

    It will create new lines for the SWIFT and\or ABA if those fields contain data.

     

     

  • Tony2021 I assume that you have used CTRL+F9 to insert the field delimiters and that you have used ALT+F9 to toggle off their display.  When the field codes are not displayed, you will not see anything unless you use the Preview Results facility.

    To have it so that the paragraph does not appear, set up your document as shown below:

     

    [Text of preceding paragraph.{ IF «SWIFT» <>""¶

    SWIFT: «SWIFT»" }¶

     

    [Text for following paragraph.]  

     

    Press the Enter key where the pilcrows (¶) appear in the above field construction.

     

    • Tony2021's avatar
      Tony2021
      Steel Contributor

      Doug_Robbins_Word_MVP 

      Hi Doug and thank you for the response. 

      I want to make sure I am doing this correct. 

       

      I press enter key as instructed but I dont see that paragraph character anywhere and when I preview the blank space is still there. 

       

      here is a screen shot:

      The yellow shade is where the field that will be hidden when ""

      Here is the output.  You can see the space where the SWIFT is ""

       

      • Tony2021 Turn on the display of non-printing characters by clicking on the Pilcrow button in the Paragraph section of the Home tab of the ribbon.

         

        The following shows the field construction that you require: