Answered by:
mail merge loop

Question
-
I have a Letter that list the address (that is the easy part) the Term that they signed up for. and the list all the classes. at the end of the letter there are a few paragraphs. the ony thing in common whith the classes and term is the person ID
so the problem i am having is when i get to the classes how to loop unitl the next person.
this is what i have so far
{SET PID1 {MERGEFIELD "IDPerson"}}{SET PID2 {MERGEFIELD "IDPerson"}}{IF PID1=PID2 "{MERGEFIELD "Date_Header"}
{address bock}
Confirmation#: {MERGEFIELD Order_Number}
this is where a table for the term info is
your classes are:
there is the tabel that need to loop
"}{SET PID1 {MERGEFIELD "IDPerson"}}{Next}{SET PID2 {MERGEFIELD "IDPerson"}} {IF PID1 <> PID2 "then print out the end of the letter"
Tuesday, February 12, 2013 6:23 PM
Answers
-
You can test the contents of a mergefield with field coding like:
{IF{MERGEFIELD Term Registration} = "True" "True response" "False respinse"}
Note: The field brace pairs (ie '{ }') for the above example are created in the body of the document via Ctrl-F9 (Cmd-F9 on a Mac) - you can't simply type them or copy & paste them from this message.
Cheers
Paul Edstein
[MS MVP - Word]- Marked as answer by Rex Zhang Thursday, February 21, 2013 2:02 AM
Wednesday, February 13, 2013 11:43 PM
All replies
-
You can use Word's Catalogue/Directory Mailmerge facility for this (the terminology depends on the Word version). To see how to do so with any mailmerge data source supported by Word, check out my Microsoft Word Catalogue/Directory Mailmerge Tutorial at:
http://windowssecrets.com/forums/showthread.php/111149-Mailmerge-Tutorial-Create-Sorted-Listings-(2000-2010)
or
http://www.gmayor.com/Zips/Catalogue%20Mailmerge.zip
The tutorial covers everything from list creation to the insertion & calculation of values in multi-record tables in letters. Do read the tutorial before trying to use the mailmerge document included with it.
For some worked examples, see the attachment to the posts at:
http://www.msofficeforums.com/mail-merge/9180-mail-merge-duplicate-names-but-different-dollar.html#post23345
http://www.msofficeforums.com/mail-merge/11436-access-word-creating-list-multiple-records.html#post30327
Alternatively, you may want to try one of the Many-to-One Mail Merge add-ins, from:
Graham Mayor at http://www.gmayor.com/ManyToOne.htm; or
Doug Robbins at https://skydrive.live.com/?cid=5aedcb43615e886b#!/?cid=5AEDCB43615E886B!cid=5AEDCB43615E886B&id=5AEDCB43615E886B%21566Cheers
Paul Edstein
[MS MVP - Word]Tuesday, February 12, 2013 9:39 PM -
Thanks so much
but if i want to check if a merge field contains a word or two how would i do that?
so if the title field, the frist two works contains "Term Registration" "True" "False"
Wednesday, February 13, 2013 4:15 PM -
You can test the contents of a mergefield with field coding like:
{IF{MERGEFIELD Term Registration} = "True" "True response" "False respinse"}
Note: The field brace pairs (ie '{ }') for the above example are created in the body of the document via Ctrl-F9 (Cmd-F9 on a Mac) - you can't simply type them or copy & paste them from this message.
Cheers
Paul Edstein
[MS MVP - Word]- Marked as answer by Rex Zhang Thursday, February 21, 2013 2:02 AM
Wednesday, February 13, 2013 11:43 PM -
Hi,
As I have not heard from you for several days. I will go ahead and close this thread. If you have any questions, please feel free to reply to us and this thread will be re-opened.
Best Regards,
If you have any feedback on our support, please click here
Rex Zhang
TechNet Community SupportThursday, February 21, 2013 2:02 AM