Problem with MS Word Mail Merge

  Nosmas 10:59 16 Jun 2003
Locked

I am trying to set up some mailing labels, using Mail Merge in MS Word from Office 97. The following is the Mail Merge conditional coding for the first line, but for the purposes of this posting I am using the character ^ to represent a space. Also the fields would normally appear as {^MERGEFIELD^Title^} but again for the purposes of this posting I am abbreviating this to {Title}. I am also using the "curly" brackets from the keyboard and not the character obtained in Mail Merge when inserting merge fields. Hope this will be clear when the text appears in the Forum.

{Title}^{^IF^{Init2} >"^""{Init1}^{Init2}^{Lastname}""{Init1}^{Lastname}"^}

The problem I am having is that where the source record doesn't have a second initial an extra space is being inserted between the first initial and the last name viz:-

Mr.^A.^^Smith instead of Mr.^A.^Smith. When a second initial is present the line is correctly shown as Mr.^A.^B.^Smith

Can anyone please suggest an amendment to the code to achieve the desired result?

  Nosmas 11:04 16 Jun 2003

For some reason my text for the IF condition has not come through properly. It should read

IF {Init2} < > "^" i.e. If Init 2 is not equal to "blank".

  pj123 11:25 16 Jun 2003

Take out all the spaces in your IF statement.

  Nosmas 11:06 17 Jun 2003

Thanks for the suggestion. I got some odd results at first, but after some experimentation I found the answer. When comparing Init2 with "blank", IF {Init2}<>"^" should be IF {Init2}<>"" i.e. there should not be a space between the two double quotes.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Alienware 17 R4 2017 review

These brilliant Lego posters show just what children's imaginations are capable of

Mac power user tips and hidden tricks

Comment réinitialiser votre PC, ordinateur portable ou tablette Windows ?