Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word 2003: Comparing mail merge fields? 1

Status
Not open for further replies.

mdieckman

MIS
Nov 21, 2006
88
US
I have created a letter off of a data source that contains two different types of addresses: one is the Primary Address and the other is a Billing Address. In my mail merge letter, I do not want to display the Billing Address if the Billing Address Tax ID does not equal the Primary Address Tax Id. Is there any way to do this using Word mail merge?

Essentially:

If «PRIMARY_OFFICE_TAXID» <> «BILLING_TAXID» then do not display

Thanks in advance!
 
Hi mdieckman,

You're almost there! To complete the task, add your 'Billing Address' mergefield to the sequence you've already got, thus:
Code:
«PRIMARY_OFFICE_TAXID» «BILLING_TAXID» «BILLING_ADDR»
Now, select all three mergefield and press Ctrl-F9 to wrap another field around them, thus:
Code:
{ «PRIMARY_OFFICE_TAXID» «BILLING_TAXID» «BILLING_ADDR» }
Now, simply fill in the field so that you get:
Code:
{IF«PRIMARY_OFFICE_TAXID»= «BILLING_TAXID» «BILLING_ADDR»}
paying careful attention to the spacing indicated.
Then run your mailmerge.

If you want to display the 'Primary Address' instead of the 'Billing Address' in the circumstances described, add the the 'Primary Address' mergefield to the code, thus:
Code:
{IF«PRIMARY_OFFICE_TAXID»= «BILLING_TAXID» «BILLING_ADDR» «PRIMARY_ADDR»}

Cheers

[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top