View Single Post
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Another Mail Merge Problem - Word 2003

You need something a tad more complex eg

{ Mergefield Town }{ IF { Mergefield County } "" "¶
{ Mergefield County } { Mergefield PostCode}" "{ IF { Mergefield PostCode }
"" "¶
{ Mergefield PostCode}" ""}"}¶
{ Mergefield Country }

When compiling this press the enter key wherever you see ¶ (and nowhere
else!)

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



wrote:
I have two Mergefields on the same line County and PostCode.
In some cases, like sending a letter to Australia, the County field is
blank but the PostCode field contains data. In an earlier post Doug
Robbins showed me how to use If-Then-Else coding to print, one or
other or both fields but I've hit another problem.

Normally, if a field is blank, the line does not print and the
remainder of the address closes up. However, in the line which
contains the code, if the both "County" and "Post Code" are blank, the
line remains, so I get a blank line between "Town" and "Country".
I've tried using a second "If" statement but it makes no difference.
Could someone please advise how I can get rid of the blank line.

Best Regards
John