locked
IF conditions introducing white lines when merging mails RRS feed

  • Question

  • Hi all,

    I am using the mail merge functionality (MS Word 2007) but in the resulting document I am visualizing white lines where I do not want.

    First of all, if I execute the following code:

     

    1 {MERGEFIELD Chapter}

    {MERGEFIELD field1 \b "this is the first field"}

    1.1 {MERGEFIELD Subject}

    {MERGEFIELD field2 \b "this is the second field"}

     

    everything works good. However, if I introduce an additional command (NEXTIF):

     

    1 {MERGEFIELD Chapter}

    {MERGEFIELD field1 \b "this is the first field"}

    {NEXTIF {MERGEFIELD Chapter}<>""}

    1.1 {MERGEFIELD Subject}

    {MERGEFIELD field2 \b "this is the second field"}

    {NEXTIF {MERGEFIELD Subject}<>""}

     

    in the resulting document there are white lines that are not desirable. My feeling is that when the IF conditions are not satisfied, then an extra line is added.

    I have tried the possible solution of "Don´t print blank lines when data fields are empty" but it does not work.

    I hope you can help me. Thank you very much in advance.

    BR, Fons.

     


    BR, Fons.
    Tuesday, September 27, 2011 10:53 AM

All replies

  • I explain better the problem and make it easier to understand; let´s take the following code:

     

    1 {MERGEFIELD Chapter}

     {IF {MERGEFIELD Chapter}<>"" "HELLO" "")

     1.1 {MERGEFIELD Subject}
     

    When the field Chapter is empty, I do not want to introduce a blank line. I have considered the following possibility:

     

    1 {MERGEFIELD Chapter} {IF {MERGEFIELD Chapter}<>"" "

    HELLO" "")

    1.1 {MERGEFIELD Subject}

     

    but it is not working for me so far; I think this is due to the fact that the point is a header of a paragraph and I cannot introduce a paragraph mark there.

     

    Thanks sou much again in advance.


    BR, Fons.
    Tuesday, September 27, 2011 4:47 PM