
Signature
Peter Jamieson - Word MVP
Word MVP web site http://word.mvps.org/
> I'm doing a mail merge with Word from Office XP. I have these fields in my
> datasource:
[quoted text clipped - 12 lines]
> insert a datasource field (AccountName) if they are not equal to each other,
> else insert nothing. How do I do this? Thanks.
That works beautifully! Thanks. I didn't realize that you were allowed to
put quotes around things.
But how can I suppress the whole line if there is nothing to display (your
empty quotes below)? I was reading that you have to encapsulate the line
break with Word 2002/XP, but I don't know how to reveal or encapsulate it.
Again, thanks.
> Insert the field directly using ctrl-F9 for the special braces and using
> Alt-F9 to toggle between "field codes" and field results".
[quoted text clipped - 27 lines]
> other,
> > else insert nothing. How do I do this? Thanks.
Peter Jamieson - 22 Apr 2004 08:23 GMT
> But how can I suppress the whole line if there is nothing to display (your
> empty quotes below)?
If what you want is
where the FirstName LastName & Accountname differ:
FirstName LastName
Accountname
further text
where the FirstName LastName & Accountname are the same:
FirstName LastName
further text
then try:
{ MERGEFIELD FIrstName } { MERGEFIELD LastName
}
{ IF "{ MERGEFIELD AccountName }" = "{ MERGEFIELD FirstName } { MERGEFIELD
LastName }"
""
"{ MERGEFIELD AccountName }" }Further text
You can put ordinary paragraph marks etc. inside the IF field results simply
by including the return inside the result text, e.g. if you have
a{ IF x = y "b" "b
" }c
then if x = y you should see
abc
and if x <>y you should see
ab
c

Signature
Peter Jamieson - Word MVP
Word MVP web site http://word.mvps.org/
> That works beautifully! Thanks. I didn't realize that you were allowed to
> put quotes around things.
[quoted text clipped - 37 lines]
> > other,
> > > else insert nothing. How do I do this? Thanks.