#1
|
|||
|
|||
If and/or in mailmerge
I am using a template to mailmerge a document using multiple "If" conditions.
The outcome should merge a letter, only if the status is not "Expired" and if definitions shows "Client/Pat" or Client/Set. Problem is, the info still merges if status is "Expired". What am I doing wrong? Attached is my template, sample db and my document after merged. IF Definition1 = Client/Pat OR Definition1 = Client/Set AND Status1 is not = Expired then letter should merge. This is the code I am using: IF{={IF{MERGEFIELD Definition1}= "Client/Pat" 1 0}+{IF{MERGEFIELD Definition1} = "Client/Set" 1 0} \# 0}>0 {IF{MERGEFIELD Status1} = "Expired" "" "Letter goes here"} |
#2
|
||||
|
||||
You need a space after the >
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thank you for responding Paul.
I placed a space after the > and tested, but got the same results. IF{={IF{MERGEFIELD Definition1}= "Client/Pat" 1 0}+{IF{MERGEFIELD Definition1} = "Client/Set" 1 0} \# 0}> 0 {IF{MERGEFIELD Status1} = "Expired" "" "Letter goes here"} |
#4
|
||||
|
||||
Are you actually completing the merge, or just previewing it?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Hi Paul
I actually ran the merge. Did it a few times. Last edited by Formd; 09-30-2021 at 07:28 AM. |
#6
|
||||
|
||||
Are you using the correct capitalizations for the tests? Also, what are the possible outputs for Definition1?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Hi Paul
After reviewing my codes several times, I removed an extra space in one of my mergefields. Because the mergefield was incorrect it did not work. After correcting the mergefield, it works. Thanks as always for your help. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to insert an image to a word mailmerge document based on the value of a mailmerge field? | Jake93 | Mail Merge | 3 | 07-02-2019 05:38 PM |
Can you CC somebody on a MailMerge? | constructionjasont | Mail Merge | 2 | 06-28-2017 06:01 AM |
Mailmerge to Email with a mailmerge attachment | Baldeagle | Mail Merge | 8 | 02-11-2013 04:40 AM |
Mailmerge to Email with a mailmerge attachment | Baldeagle | Mail Merge | 13 | 05-29-2012 02:04 PM |
Help with mailmerge??? | foxtrot1981 | Mail Merge | 0 | 12-03-2010 08:21 AM |