|
Mail Merge geeks
Anyone got any experience with IF statements in mail merges?
I have an excel spreadsheet, with for arguments sake:
Field 1 = First_Name
Field 2 = Surname
Field 3 = Company
In my mail merge, I want to be able to say 'Dear First Name + Surname'
However, if the first name and surname fields are blank, I want it to say 'Dear Company' instead.
My understanding of this would be to use code like this:
Dear {IF {MERGEFIELD "First_Name"} {MERGEFIELD "Surname"} = "" {MERGEFIELD "Company"} ELSE {MERGEFIELD "First_Name" {MERGEFIELD "Surname"}}
But it's not working properly. The above displays "Dear Surname" if the name fields aren't blank, and just "Dear = " if the name fields are blank.
Could anyone tell me where I've gone wrong with my code? I've never been good with IF / Else statements in general, not just in Word.
Cheers.
|