Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail-Merge Grouping (is it possible?)

Status
Not open for further replies.

benjamenus

Programmer
Dec 3, 2001
157
0
0
GB
Hi

Just wondering if it is possible to do grouping in a Word mail merge? For example, if my data source looked like this:

NAME, PETS
Colin, Dog
Colin, Cat
Colin, Fish
Dawn, Dog
Dawn, Parrot

Would it be possible to group on NAME so that 'Colin' was treated as one record, so therefore there would only be one letter generated, but that letter could contain all of Colin's pets (the same would be true for Dawn and her pets). The important thing here is that there would be N pets (ruling out the option of having fields PET1 PET2 PET3, etc).

The obvious workaround would be to write a report in Access, but I'm surprised this is not achievable in Word.

All advice appreciated.
 
To use mail merge you need one record per letter.

I'm not a Pivot Table expert but it seems like you should be able to generate a new table using Excel with

Colin, Dog,Cat, Fish

that you could subsequently use for your mail merge input in Word.

Dino
 
Thanks for the advice.

I think I may have found a solution:


{ If { MERGESEQ } = "1" "{ MERGEFIELD Name }" ""}<ENTER>
{ SET Place1 { MERGEFIELD Name }}<ENTER>
{ If { Place2 } <> { Place1 }"<ENTER>
-----------------Page Break-------------------
{ MERGEFIELD Name }<ENTER>
<ENTER>
{ MERGEFIELD Pet }" "{ MERGEFIELD Pet }" }{ SET Place2 { MERGEFIELD Name }}<ENTER>

However, I haven't yet got it to work!
 



Hi,

Take a look at Mail Merge in Excel faq68-4223

I would use Excel for variable list application. Use MS Query (Data/Get External Data...) to query your list by Name as a Parameter. There is a feature of MS Query that fires the query each time the parameter cell value changes. Then all you need is a simple for...next loop to stick each name in the parameter cell, fire the query and print the sheet containing the "letter."

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Thanks again

I think the solution offered here


is a true solution to the problem whereas the others are workarounds (all good to know though).

I did actually get it to work, you just have to perform the merge before you see the true results.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top