Share via

Adding Bordered Table Row per Record in Mail Merge

Anonymous
2016-01-22T15:27:35+00:00

Hello All,

I'm trying to merge two columns of a worksheet into a table into a letter.  Simple enough.  I have no issue populating the rows with the correct data, nor creating the next document when the next record is reached.  What has me stumped is this:

I want to create a bordered table, which has only as many rows as is needed per record.  

For instance, if record 1 has 3 rows of data, then I want the table to have 3 bordered rows.  If record 2 has 10 rows of data, I want 10 bordered rows of data.  And so on.  

I'm using the latest version of Word (365).  

Not sure if this is possible, but I figure if anyone knows, it's you folks.  

Thanks!

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
2016-01-22T23:41:38+00:00

Use the Many to One facility on my Merge Tools Add-in.

You can download the MergeTools – 20150422.dotm Add-in that I created from the following page of my One Drive:

http://bit.ly/1hduSCB

Do NOT open the MergeTools – 20150422.dotm file.(There are no user serviceable parts inside and it should NOT be used as the basis for creating your mail merge main document.) 

The MergeTools – 20150422.dotm file needs to be saved in the Word Startup folder.  In Windows Vista and Windows 7, 8 or 8.1, and 10, the default location for that folder is

C:\Users[User Name]\AppData\Roaming\Microsoft\Word\STARTUP

If you do not see the AppData folder: -

In Windows 7, - In Windows Explorer, click on the Organize drop down and then on Folder and search options and in the Folder Options dialog, go to the View tab and select the item "Show hidden files, folders, and drives".  While there, it is a good idea to uncheck the box for "Hide extensions for known file types".

In Windows 8,  8.1 or 10, in the File Explorer, click on Options on the View tab of the ribbon and then on the View tab in the dialog that appears and select the item "Show hidden files, folders, and drives".  While there, it is a good idea to uncheck the box for "Hide extensions for known file types".

 When that has been done and Word is started\re-started, the tab shown below will be added to the Ribbon:

The requirements for using the system are:

  1. The mail merge main document must be of the Letter type, though that does not mean that the output cannot be sent as an e-mail message.
  2. For the Many To One, Merge with Attachments and Merge to Individual Docs utilities, the data source may be either a table or query in an Access database, or in the form of an Excel worksheet and that worksheet must be the first sheet in the Excel workbook. If the data is on some other sheet, you can easily move that sheet so that it is the first sheet in the workbook by clicking on the sheet tab and dragging it to the left.  For the Chart Merge utility, download the Mail Merging with Charts document that is also on that page of my OneDrive for additional requirements of the data source for use with that utility
  3. For a data source in the form of an Excel worksheet, the field names must be in the first row of the worksheet and there must be a field name in all of the cells in that row that are within the range of columns that contain the data.
  4. For both types of data source, the field names must contain only alphanumeric characters (No @,#,$,%,&,(,), etc) and the field names must not start with a numeric character (0-9). The number of characters in the field names, including spaces, must not be more than 40.
  5. For a data source in the form of an Excel worksheet, the data must start in the second row of the worksheet and there should be no empty rows within the range of data that is to be processed.
  6. If there are multiple addressees in either the To or CC fields of the data source, the email addresses need to be separated by a semi-colon.

NOTE: The MergeTools applications cannot handle “Compound” MergeFields such as the «AddressBlock» or «GreetingLine».  Instead of using those fields, you will need to insert the individual merge fields.

You may also want to download:

  1. the Merging with Attachments document that is also on that page which explains how the system is used.  It is not actually necessary to have separate attachments as the facility can be used to send just the documents created by the merge itself as attachments, either as the body of the message itself or in the form of Word files or .pdf files.
  2. the Mail Merging with Charts document that is also on that page.  That document explains how you must set up the Excel Data Source and the Mail Merge Main document to be able to execute a merge with a Chart that is unique to each record in the data source.
  3. the Using the Many to One Facility document that describes how to use that facility.

Was this answer helpful?

0 comments No comments

Answer accepted by question author

Paul Edstein 82,861 Reputation points Volunteer Moderator
2016-01-22T21:47:23+00:00

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/showthread.php/154370-Microsoft-Word-Catalogue-Directory-Mailmerge-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-merge/9180-mail-merge-duplicate-names-but-different-dollar.html#post23345

http://www.msofficeforums.com/mail-merge/11436-access-word-creating-list-multiple-records.html#post30327

http://windowssecrets.com/forums/showthread.php/157725-Word-2010-Merge-from-excel-into-Table-Directory?p=928391&viewfull=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/office/forum/office_2010-word/many-to-one-email-merge-using-tables/8bce1798-fbe8-41f9-a121-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

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful