#  Other Applications & Softwares  > Word Formatting & General >  >  Group Fields in Mail merge based on common field

## Sinon05

Hi there! I have a task at work that requires the use of mail merge letters (these are to be printed in the end not sent via email).

Basically, we have a database of companies that are grouped in their own categories (column B -  "Group" in the spreadsheet), each purchasing a product valued at one of two costs. Cost 1 refers to payments before a certain date and Cost 2 refers to later payments. In the letters, we are trying to show the clients (Column C - "Client Name) how much they would have to pay before and after the date (the date is 1st April but is irrelevant here as the prices have already been set in the spreadsheet). Furthermore, if the clients decide to buy multiple products, they get a discounted total price (column E - "Reduced Cost 1" and column G - "Reduced Cost 2"), also based on when they make the payment. In my table, I chose to put the discounted total price for all the lines but I really only need it for a total number.

What I am trying to achieve is to be able to save and print individual letters per group. I've tried adapting some code I found online but I can't make it work. To make it worse, we absolutely have to use a table in word to show all the clients and the prices. this only confuses me further as I could find no code to help with setting up the data in a table in Word the way I need it. i have attached the spreadsheet with some sample data (i have over 90 groups) and also how the document looks before the mail merge and how I would like it to look like in the end.

I wouldn't mind having to change the spreadsheet to get it into a better format for the mail merge, it doesn't have to have this current format. My requirements are to get 1 letter per group and keep in the table in Word.
Any help would be greatly appreciated. Thanks

FYI: I've tried the following links:
https://www.youtube.com/watch?v=bld2UWKdTmo
https://www.youtube.com/watch?v=4Ck8KAwAQso
http://www.stacydubois.com/2013/01/t...g-problem.html
I've also posted on Mr Excel Forum - http://www.mrexcel.com/forum/general...mon-field.html

----------


## macropod

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/sho...merge-Tutorial
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.

The field coding for this is complex. However, since the tutorial document includes working field codes for all of its examples, most of the hard work has already been done for you - you should be able to do little more than copy/paste the relevant field codes into your own mailmerge main document, substitute/insert  your own field names and adjust the formatting to get the results you desire. For some worked examples, see the attachments to the posts at:
http://www.msofficeforums.com/mail-m...html#post23345
http://www.msofficeforums.com/mail-m...html#post30327
http://windowssecrets.com/forums/sho...l=1#post928391

Another option would be to use a DATABASE field in a normal ‘letter’ mailmerge main document and a macro to drive the process. An example of this approach can be found at: http://answers.microsoft.com/en-us/o...1-1996c14dca5d

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 http://bit.ly/1hduSCB

In addition to a 'Many to One' merge, the latter handles:
• Merge with Charts
• Duplex Merge
• Merge with FormFields
• Merge with Attachments
• Merge to Individual Documents
• Merge, Print and Staple

----------


## macropod

Cross-posted at: http://www.mrexcel.com/forum/general...mon-field.html
Please read the Cross-Posting policy in rule #8: http://www.excelforum.com/forum-rule...rum-rules.html

----------

