Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Insert a MM field if there is a paticular value in another field
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. |
#2
|
|||
|
|||
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 "Alex James" wrote in message ... 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. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mail Merge Field window should remain open to insert multiple fiel | Mailmerge | |||
Insert a file into a merge field | Mailmerge | |||
Mail merge field different in datasource & insert a field menu | Mailmerge | |||
How do I insert a field in a dialog box? | Microsoft Word Help | |||
How do I insert a field into a MS Word so I can use the first and | Mailmerge |