Problem with MS Word Mail Merge

  Nosmas 10:59 16 Jun 03
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 03

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 03

Take out all the spaces in your IF statement.

  Nosmas 11:06 17 Jun 03

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.

Huawei P10 review

1995-2015: How technology has changed the world in 20 years

An overview: What leading creative agencies are doing to improve diversity

New iPad, iPhone SE & Red iPhone 7 on sale now