Condition mail merge on 2 fields

T

TonyN

I need to merge a txt file with fileds that include company, firstname, and
lastname (there are other fields in the merge data).

The data souce automatically puts together firstname+lastname into the field
company, for people who don't have a company name entered. I can't change
that.

So, when I merge the data, the name prints out twice for those whose
companyname was a merged firstname+" "+lastname.

I tried something like:
{IF {MERGEFIELD firstname} = {MERGEFIELD company} "----------" {MERGEFIELD
company}

But I think I need to define firstnam+" "+lastname to compare to company.

How do i do this?
 
D

Doug Robbins - Word MVP

What do you mean by "The data souce automatically puts together
firstname+lastname into the field
company?" You mean that the firstname + lastname is automatically repeated
in those fields in the data source as well as in separate firstname and
lastname fields?

If that is the case, your field construction should be something like

{IF {MERGEFIELD company} <> "{MERGEFIELD firstname} {MERGEFIELD lastname}"
"{MERGEFIELD company } Cr
{ MERGEFIELD nextmergefield }" "{MERGEFIELD nextmergefield}" }

where you insert a carriage return (Press Enter or Shift+Enter) where Cr
appears in the above.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top