View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Formatting Mergefield Problems

You are only adopting half a solution. You should conditionally insert the
field AND the line break eg
{Mergefield Field1}{IF {Mergefield Field2} "0" "
{Mergefield Field2}{IF {Mergefield Field3} "0" "
{Mergefield Field3}etc

--

Graham Mayor - Word MVP

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




malycom wrote:
Hi

I have looked up and found lots of similar problems with this but I
haven't found a specific answer.

By the way, this is the first time this problem has happened to me
and I have done dozens of merges so I don't know what's happened.

Firstly, my merged data from Excel is inserting a 0 where a filed is
blank.

Example
Mr Name-1 Name-2
43 Some Street
City
0
0
0 postcode

Should look like

Mr Name-1 Name-2
43 Some Street
City
Postcode

I have tried things such as {IF{MERGEFIELD 'Excel data'} 0
"{MERGEFIELD 'Excel data'}"} but this merely took out the zero
leaving blank lines kind of like this

Mr Name-1 Name-2
43 Some Street
City


postcode

I then found this function {MERGEFIELD ExcelData \# 0;;} which
removed the blank lines but this has thrown up another error.
Anywhere there is more than one word in a mergefield, only the first
word is displayed and anything including and after the first space is
missing. Again, kind of like this.

Oh, and the Mr, Name-1 & Name-2 are 3 seperate Mergefields so they
are ok.

Mr Name-1 Name-2
43
City
NW1

So, the 'Some Street' of '43 Some Street' is missing from address_1
and the second part of the post code is missing after the space.

I hope I haven't made this to confusing.

Any healp is greatly appreciated.

Oh, Merry Christmas everyone.