![]() |
|
#9
|
||||
|
||||
|
As was said previously, all the variable content could be handled via field coding within the document. For example, if you have a column named 'Code' with the codes as per post #5, you could use a single field coded as:
{IF{MERGEFIELD Code}= "D1" "Letter body for Damaged Consumer Use"} or: {IF«Code»= "D1" "Letter body for Damaged Consumer Use"} to output all the text for the 'Damaged Consumer Use' letter. Simply stringing these together, as in: {IF{MERGEFIELD Code}= "D1" "Letter body for Damaged Consumer Use"}{IF{MERGEFIELD Code}= "D2" "Letter body for Damaged Fixed"}{IF{MERGEFIELD Code}= "D3" "Letter body for Damaged Lab Report"}, etc. or: {IF«Code»= "D1" "Letter body for Damaged Consumer Use"}{IF«Code»= "D2" "Letter body for Damaged Fixed"}{IF«Code»= "D3" "Letter body for Damaged Lab Report"}, etc. is all that would be required to generate all possible letters. The conditional Letter Body output can include multiple paragraphs, more mergefields, tables, pictures, and so on. Similarly, mergefield field switches can be used to suppress text before and/or after a mergefield when that field is empty. Examples of that are shown in the Mailmerge Tips and Tricks 'Sticky' thread at the top of this forum: https://www.msofficeforums.com/mail-...ps-tricks.html Note: The field brace pairs (i.e. '{ }') for the above examples are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practicable to add them via any of the standard Word dialogues. Likewise, you can't type or copy & paste the chevrons (i.e. '« »') - they're part of the actual mergefields, which you can insert from the 'Insert Merge Field' dropdown. The spaces represented in the field construction are all required.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Multiple mail merge
|
PKAYHORM | Mail Merge | 1 | 09-29-2013 07:45 PM |
| Mail merge with a hyperlink for multiple recipient with different url's? | prkk.06 | Mail Merge | 6 | 05-01-2013 06:42 AM |
Mail Merge multiple rows?
|
ender541 | Mail Merge | 1 | 08-21-2012 03:14 PM |
Multiple Mail Merge?
|
imogul | Mail Merge | 1 | 06-24-2011 07:20 PM |
Generating multiple documents from 1 data source
|
themangoagent | Word | 2 | 08-14-2009 12:12 PM |