#1
|
|||
|
|||
Mail merge { IF {....
Greetings!
I'm fairly new to mail merge docs and have inherited a mess. The mail merge works except for populating with department head names/titles and I can't seem to get it to work right. What I'm looking for is something similar to this: { IF {MERGEFIELD DeputyDirector} persons name and title} { IF {MERGEFIELD AssistantDirector} persons name and title}{ IF { MERGEFIELD deputy director and assistant director} names and titles} I may be over thinking it. I don't know. I do know about Ctrl+F9. I just need the right syntax and can't seem to get it right. Usually it comes back blank. |
#2
|
||||
|
||||
What are the actual field names in the data source? It seems unlikely you'll have three separate fields named 'DeputyDirector', 'AssistantDirector', and 'DeputyDirector and AssistantDirector' there.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
There are only two data fields. What I need is for the mail merge to do is populate if it is either one or the other or both. So Deputy director or assistant director or deputy director and assistant director. I need it to: if deputy director then deputy director+name or if assistant director then assistant director+name or if deputy director and assistant director then both+name.
|
#4
|
||||
|
||||
You still have said what the field names in the data source are...
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Sorry, thought I did. It's:
ProcessFields_AssistantDirectorApproval ProcessFields_DeputyDirectorInfrastructureProgramm ingApproval It's pulling from an online database that we don't manage in-house. |
#6
|
||||
|
||||
You could use a field construction like:
Code:
{IF«ProcessFields_AssistantDirectorApproval»<> "" "Assistant Director text{IF«ProcessFields_DeputyDirectorInfrastructureProgrammingApproval»<> "" " and "}}{IF«ProcessFields_DeputyDirectorInfrastructureProgrammingApproval»<> "" "Deputy Director Infrastructure Programming text"}
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Okay, I'll give it a run through and see what I get. Thank you for your assistance, it's greatly appreciated.
|
#8
|
|||
|
|||
Okay, I've given it a few tries and can't seem to get it to populate correctly.
Either it comes up blank, which means I didn't do it correctly, or it shows "Assistant Director name and" without the quotes. |
#9
|
|||
|
|||
This is exactly what I've got in the field:
{IF«ProcessFields_AssistantDirectorApproval»<> "" "Assistant Director Khalid Bazmi{IF«ProcessFields_DeputyDirectorInfrastructur eProgramming»<> "" " and "}}{IF«ProcessFields_DeputyDirectorInfrastructureP rogramming<> "" "Deputy Director Infrastructure Programming Nardy Khan"} Is there a way to add a return line between the two also? Last edited by Zenoman; 03-05-2019 at 04:01 PM. Reason: Question |
#10
|
||||
|
||||
You can have pretty much whatever content you want. For example, where I've shown " and ", you might replace either or both spaces with line breaks or paragraph breaks.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Update & Unlink Specific Merge Field in Word Doc from Mail Merge - Excel VBA | RMerckling | Mail Merge | 16 | 05-17-2018 05:19 PM |
How do I mail merge records into table columns with more than one merge field? | tech123 | Mail Merge | 1 | 04-26-2017 07:13 PM |
Mail Merge is Deleting objects in my header and footer during the merge | bgranzow | Mail Merge | 9 | 06-05-2015 05:03 AM |
Mail merge how to link mail merge field value to a column heading | dsummers | Mail Merge | 1 | 05-08-2014 02:59 PM |
Saving INDV mail merges During the mail merge | sedain121 | Mail Merge | 2 | 10-04-2011 07:52 PM |