Mail Merge Tables

Office app (add-in) for Microsoft Word



Mail Merge Tables


Mail Merge Tables is an app for Microsoft Word available in the office store. It allows mail merges to be based on data that is in a one to many format. Have you ever wished you could include a table of data related to each individual letter in your mail merge? Well now you can. Simply point Word at your header data as usual, then point Mail Merge Tables at your line data.

Examples include:

  • Invoices / Invoice Lines
  • Football Clubs / Players
  • Workshops / Attendees
  • Students / Achievements
  • Installers / Licenses
  • Markets / Stalls
  • Kitchens / Rosters
  • Webinars / Clients
  • Tours / Destinations



The best way to get started is to watch the short (3 minute) demonstration video. A detailed walkthrough is also available below. All the files used in the video/walkthrough are available for download.


Video Demo



Walk Through

1 - Download the demo files

Download the following 3 demo files to your device (or prepare your own).

The first row of the InvoiceHeader and InvoiceLines data files is the field names, or headers. One of these fields must be present in both files. This field is referred to as the linking field. This field tells the app which lines belong with each letter. In this case it is InvoiceNumber:


2 - Open the demo Word document and insert the linking field

When you open the document you will need to relink it to the InvoiceHeader.csv file you downloaded.
Insert the merge field that the app will use to link the two sets of data. It must be present in both csv files. In this example it is the Invoice Number. Position the linking field where you want your table to be located. In the demo document you downloaded the field is already inserted for you.

3 - Open the Mail Merge Tables app

On the word menu go to Insert > My Apps > Mail Merge Tables


4 - Select (highlight) the linking field

Select the linking field using your mouse or the shift and arrow keys. It is not enough to simply click on the field.

not selected (lighter)
selected (darker)
The easiest way to properly select it is to left-click on the right of the field, and drag across to the left.
5 - Click 'Insert table...'

This will open a browse box allowing you to browse to the location of the InvoiceLines.csv file. The app will then insert a table for you. The structure of the table will be based on the columns in the csv file.

6 - Format the inserted table

Now format the table as you wish. You can design the Mail Merge Table in exactly the same way as you would a normal Word table. See the relevant FAQ for more details.

7 - Run the normal Word mail merge as usual

You can save the Mail Merge Table template, to re-use it another time (Word menu: File / Save).
Now run the normal Word mail merge as you usually would, this will fill your document with header data from InvoiceHeader.csv


8 - Re-open app

Re-open Mail Merge Tables. Office apps are attached to a document. Because the Word mail merge has just created a new document (the Word mail merge result) it is necessary to re-open the app.


9 - Run the table merge

Before you click the 'Fill Table...' button, make sure you have selected the entire document (Word menu: Home > Select > Select All). When you click the button you will be asked to browse to the InvoiceLines.csv file. This time the app uses the file to fill the tables with data.

first select the entire document (important)
then click Fill Tables in the app

Files used in Demo

The files used in the demo can be downloaded here:



FAQ

Can the tables be of variable length?

Yes. This happens automatically based on your lines data. In the example above one coffee shop has 2 invoice lines, and another 4.

Editing and formatting of the template table. What can I do?

The table can be styled and formatted as any other table in Word can be.
You can -

  • Edit the column names.
  • Delete one or more columns.
  • Delete the header row. If you don't want headers in your table, just delete it.
  • Add a row. You can add one or more rows to the table as long as you do not split the two rows containing the hashes (##). The app needs these 2 rows.
  • Add a formula to a totals row.
  • Apply formatting to rows, columns and fields.

Editing and formatting of the template table. What can't I do?

  • You cannot delete the rows filled with hashes (##). These are place holders for the data that will eventually fill the table. They are needed by the app.
  • You cannot add a column. If you need another column, then add it to your source csv file.

Can Word formulas be added to a footer row?

Yes, simply add the formula, e.g.: a total. Once the tables are populated with data you need to deselect and reselect the entire document and press F9 to allow Word to re-calculate the formula.

What format files does Mail Merge Tables support?

Your header data can use any file format that Word supports (Excel, csv, txt, etc). The lines data (that fills the tables) must be in csv file format.

What is a csv file?

Csv stands for Comma Seperated Values. They are text files that most software can use to import or export data. You can create and edit csv files using Excel spreadhseets: File / Save As / Save as type CSV (MS-DOS) .*csv

Why are there hashes in the template table?

The hashes get replaced with your data in the Fill Tables step. They are used as placeholders and indicate approximate column widths. Please do not delete them.

Can more than one table be merged?

Yes, you can have as many tables as you like.
Each table must be powered by it's own csv file. Each table must have a unique field name that is also in the header data. For example, you may wish to display invoice lines in one table and special offers in another.

To achieve this you need three csv files:

  • InvoiceHeader.csv
  • InvoiceLines.csv - the linking field is InvoiceNumber (this is present in InvoiceHeader.csv as well)
  • SpecialOffers.csv - the linking field is SpecialOfferCategory (this is present in InvoiceHeader.csv as well)
Then simply insert two tables into your mail merge template (one based on InvoiceLines.csv and one based on SpecialOffers.csv) Finally, when you have completed the Word merge you will need to run the fill tables process twice (once for each csv file).

Can I merge straight to email?

No, not currently. Please use the Edit Individual Documents merge option. In order to populate the tables with data Mail Merge Tables needs to edit your merge document after it is created. It cannot do this if they have beens sent direct to emails.

What versions of Word can I use?

Mail Merge Tables is an app for Office (Office add-in). Like all the apps in the Office Store, it needs Word 2013 or above. It cannot be run in Word 2010 or an earlier version.

I've saved a Mail Merge Tables template, what can I do with it?

You can re-use it with new csv files that have the same fields, but updated data. You cannot re-use it with csv files that have a different structure.


Privacy

The app never collects, stores, or transmits any data. All data is processed on your device.