Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 10-16-2015, 12:03 AM
macropod's Avatar
macropod macropod is offline Mail Merge - generating multiple letters Windows 7 64bit Mail Merge - generating multiple letters Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,513
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge - generating multiple letters 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 - generating multiple letters Mail Merge multiple rows? ender541 Mail Merge 1 08-21-2012 03:14 PM
Mail Merge - generating multiple letters Multiple Mail Merge? imogul Mail Merge 1 06-24-2011 07:20 PM
Mail Merge - generating multiple letters Generating multiple documents from 1 data source themangoagent Word 2 08-14-2009 12:12 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:30 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft