Insert a MM field if there is a paticular value in another field

A

Alex James

I have two seperate address blocks (as seperate fields) in my data source. I
want to use either 'address block A' or 'address block B' in the mail merge
based on a preference indicated in the data source. So 'IF field <<pref>> =
"A" merge 'address block A' else merge 'address block B'' is basically what I
want to do. I can use IF statements for merging text from different
documents based on this type of criteria but not different merge fields. Any
help greatly appreciated.
 
D

Doug Robbins

You can use another mergefield in the results for an If...then...Else field.
Rather than use address blocks however, you will probably need to use an
If...then...Else field for each mergefield that makes up the address block.

{ IF { MERGFIELD pref } = "A" { MERGEFIELD Aaddress1 } { MERGEFIELD
Baddress1 } }
{ IF { MERGFIELD pref } = "A" { MERGEFIELD Aaddress2} { MERGEFIELD
Baddress2 } }
{ IF { MERGFIELD pref } = "A" { MERGEFIELD Acity } { MERGEFIELD Bcity } }

etc.
--
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