#1
|
|||
|
|||
Help with a complex mail merge
Hi everyone. I have a very tricky piece of work to complete. I've put the hours in and come up with my template in word for the mail merge. It all works and is looking good. The only problem is there are some parts that I do not want to show up (and therefore print off) if the value of a particular data field is nothing. This is very hard to explain, so I have attached a pdf which (hopefully) illustrates what I am after. If you can help I would be very grateful. |
#2
|
||||
|
||||
Hi bekz,
This is easily done by embedding the entire 3rd page in an IF field coded like: {IF«DFKEY1»<> "" "The entire 3rd page"} To do this, simply insert a «DFKEY1» mergefield at the start of the 3rd page, then select the entire 3rd page, then press Ctrl-F9 to enclose it in a pair of field braces, so that you get something like {«DFKEY1»'The entire 3rd page'}. Then add the remaining text that makes up the IF test, including the double-quotes before & after the 3rd page's content. Be careful to inlcude the spaces shown in the field construction. If, as I suspect, you have a page break at the end of the 2nd page, you'll need to include that in the field as well. The simplest way of doing that is to insert another field into the expression, thus: {IF«DFKEY1»<> "" "{QUOTE 12}The entire 3rd page"}, then delete the actual page break at the end of the 2nd page. When you're done, press F9 to update the field code, then run your mailmerge. Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message. Likewise, you can't type or copy & paste the chevrons (ie '« »') - they're part of the actual mergefields, which you can insert from the mailmerge toolbar.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Sorry for the massive delay
I got very frustrated with this and nearly threw the computer out the window. I've had a nice long break from it, and coming back with fresh eyes it's making sense and working...kind of.
When I key in the required coded fields I manage to get all the information to disappear. The first question is, how do I see it again if I want to change it because it's wrong? I can't actually see the IF field information... The second question is, I have tested it with my data. I have found one of the few entries that contain a value for DFKEY1, however when I view the merged data, the information does not return for this entry. As therre is information in DFKEY1 for the entry, I would have expected for all of "the entire third page" to come back with the appropriate information inserted into the merged fields. Bit confused now... lol |
#4
|
||||
|
||||
Hi bekz,
You can view the field coding via Alt-F9. If you're only previewing the merge, the display won't reliably reflect the output - you'll need to actually finish the merge to see what you'll get. If you can post some sample data, plus your latest version of the document, I'll take a look at it for you. It may be a day or two, though, as I'm busily working on a uni assignment.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Very appreciated
I would love it if you could take a look! I don't mind how long it takes! Any help would be great. I have completed the merge and viewed the data, however it doesn't show up with the additional information when the DFKEY1 HAS data in it. I'm very confused. Have a look when you have time and let me know what you think. Please note that the data file (excel) I have given you is just a sample - there are 470 in my real file. Also, I have changed the information for privacy, so if you refer to any information, please just refer to the merged fields.
|
#6
|
||||
|
||||
Hi bekz,
See attached. You'd omitted a space in the DFKEY1 IF test. It's the little things that get you. Also, you had the DFKEY1 field's IF test embedded in the DFKEY2 field's IF test, meaning that the DFKEY1 field's output could only ever display if the DFKEY2 field's output was displayed. Plus, with the field coding you had, there'd be two page breaks before the DFKEY1 field's output displayed, but none between it and the DFKEY1 field's output. As it appears the DFKEY1 field's output is meant to be positioned ahead of the DFKEY2 field's output, I've simply moved the whole of the DFKEY1 field (including its IF test) so that it occurs before the DFKEY2 field and its IF test.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Genius
Thank you so so so so much! I don't know what I would have done without your help. Safe to say I would definately have less hair after tearing chunks out.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Complex array formula | andrei | Excel | 9 | 02-03-2012 03:40 AM |
Conditional merge fields in mail merge | Aude | Mail Merge | 1 | 01-06-2012 07:38 PM |
From a beginner: Mail Merge using Windows Mail | mhalpern705 | Mail Merge | 3 | 12-16-2011 04:58 AM |
Complex Find and Replace | paulkaye | Word | 1 | 11-13-2011 04:23 AM |
Saving INDV mail merges During the mail merge | sedain121 | Mail Merge | 2 | 10-04-2011 07:52 PM |