View Single Post
 
Old 03-14-2015, 01:19 PM
ryano ryano is offline Windows 8 Office 2013
Novice
 
Join Date: Mar 2015
Posts: 3
ryano is on a distinguished road
Default Mail Merge Multiple Rows Into One Document Grouped

I've found some help other places on the Internet to try and make this happen, but it's not working for me. Basically I have a very simple spreadsheet that looks similar to this except with many more rows and groups:

PHP Code:
Group   |   Name    |   Phone
Group 1 
|   Ryan    111-222-3333
Group 1 
|   Katie   112-223-3343
Group 2 
|   Josh    141-181-3183
Group 2 
|   Emily   129-831-4913
... 
etc.

And I want to mail merge multiple rows onto each sheet in Microsoft Word based on the Group column. Currently, everything's loaded in Word properly (including "Group" being sorted ascending).

This is the code:

Code:
{QUOTE{IF{MERGESEQ}=1 {SET Key “”} {SET LastKey {Key}}}{IF{MERGEFIELD Group}<> {Key} “{IF{MERGESEQ}> 1”
 
{IF{MERGEFIELD Group}<> 0 {QUOTE 12}}”}{IF{MERGEFIELD Group}<> 0 “Text: {SET Key {MERGEFIELD Group}}
 
{MERGEFIELD Group \* Charformat}
 
“}”}”{IF{MERGEFIELD Group}<> 0”{MERGEFIELD Name}/{MERGEFIELD Phone}”}”}
(The above brackets were used by pressing Ctrl+F9)

But I'm only getting this sort of result (one per page) when I preview:

PHP Code:
Ryan 111-222-3333 
When the desired result would be the "text" in the code above, along with all of the people's names and numbers in that group.
Reply With Quote