# Excel to MS Word Mail Merge - how to create multiple directories broken up by a field category



## susaneey (Jun 28, 2017)

I have a mail merge directory that i've created using MS Word, which pulls data from an excel spreadsheet of project team itineraries. The data is constantly being updated - people quit, locations close, people run over schedule at a stop on the list, and so the reports need to be constantly reprinted. 

Does anyone have suggestions for how I might set up the merge to create multiple itineraries broken down by a specific field category - in this case, the team name? 

For this example, I might have a hundred locations that get assigned to one of six teams - I want to generate six itineraries with only the dates and locations relevant to each team. 

A second problem I have is that the number of rows I need for each directory varies - some teams have more locations assigned to them than others. The spreadsheet data is being constantly changed, and one type of change that sometimes happens is a location gets deleted - so even within team paths, the number of locations could go up or down at any given time. 

If there is a better approach to this than using MS Word, I'd also love to hear your thoughts! Thank you.


----------



## Macropod (Jun 29, 2017)

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:
Microsoft Word Catalogue/Directory Mailmerge Tutorial | Windows Secrets Lounge
or:
http://www.gmayor.com/Zips/Catalogue Mailmerge.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:
mail merge with duplicate names but different dollar amounts
Access to Word, Creating a list from multiple records
Word 2010 Merge from excel into Table Directory | Windows Secrets Lounge

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/...g-tables/8bce1798-fbe8-41f9-a121-1996c14dca5d
The DATABASE field can even be used without recourse to a mailmerge. An example of such usage can be found at: Mail merge into different coloumns

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


----------



## tonyyy (Jun 30, 2017)

susaneey,



> If there is a better approach to this than using MS Word, I'd also love to hear your thoughts!


The sample Word doc looks a lot like an Excel table, so you might consider "extracting" data to a PivotTable - actually six of them, one for each team.  Whenever the data changes just click the Refresh button and all the PivotTables will update.

Cheers,

tonyyy


----------

