Mail Merge to Email with Attachments

Home Up Search This Site What's New? Audio On CDR Favourites Downloadable files Photo Gallery 2002 Photo Gallery 2003 Photo Gallery 2004/5 Photo Gallery 2006/7 Photo Gallery 2008 Photo Gallery 2009/10 UK Photo Gallery Ireland Photo Gallery Cats Photo Gallery 

 

 

Google
 

Many people access the material from this web site daily. Most just leech what they want and run. That's OK, provided they are not selling on the material as their own; however if your productivity gains from the material you have used, a donation from the money you have saved, however small, would help to ensure the continued availability of this resource.

Click the appropriate button above to access PayPal.

Add-in to merge separate files to e-mail as attachments

 

The add-in discussed on this page was developed from a macro produced by fellow Word MVP Doug Robbins to mail merge attachments, which is discussed at http://word.mvps.org/FAQs/MailMerge/MergeWithAttachments.htm.

The add-in is designed to work in conjunction with the merge splitting add-in which you will find discussed elsewhere on this site,

The aim is to take the individual merged letters produced by that add-in and e-mail them to the e-mail recipients whose e-mail addresses are stored in the same data file that was used to produce the separate documents. If you have more complex merge requirements, then please refer to Doug's article at the above link.

To take advantage of the features of Word 2007, I have produced a separate version of the add-in for Word 2007 users.

Note:

This add-in is provided in two versions - a dot format template intended to work with Word from version 2002 and 2003, and a dotm format template for Word version 2007. Extract only the relevant template from its sub folder in the zip file to the Word startup folder, which by default can be found by typing

%appdata%\Microsoft\Word\STARTUP

in the address bar of your Windows Explorer application or browser. If you don't have write access to this folder, ask your IT support to install it for you.

++ This function requires the use of Outlook to send the messages!

++ The Individual Merge Letter add-in has error trapping to cover the issue of duplicate or missing data or data with illegal filename characters. This function does not, so relies on the filenames of the attachments to be extracted from unique field data. If necessary create a new field to ensure that the filenames produced are unique.

 

The add-ins use the settings file created during the merge splitting process, so ALWAYS create the individual documents before attempting to run the macros.

The add-in creates a new group on the Mailings ribbon of Word 2007 and a custom toolbar in Word 2007. Apart from the fact that the 2007 version works in Word docx format, and the 2003 version works in Word doc format, the templates are functionally identical.

In Word 2002/3 these functions are activated from toolbar buttons. The toolbar should be displayed the first time you run Word with the add-in present.

Initially the toolbar will be displayed in the document space.

If you don't require the function you can close the toolbar, by clicking the X on the title bar of the toolbar, and re-activate it as required from View > Toolbars.

 

When run, the macro displays the following dialog as a reminder to first create the separate documents.

Clicking OK prompts for the data file that was used to create the separate merge documents, and which contains the email addresses for the recipients of the documents.

Select the data file and click OK.

The macro then asks the user to select the required format of the attachments. This must reflect the format of the prepared documents.

The macro creates a new document with a single row table (the illustration is from Word 2007, but the appearance in 2003 is virtually identical) and presents a prompt to select the data field that contains the e-mail addresses.

Click OK to close the dialog box, then select the field and click OK

The macro then fills the table with the e-mail addresses and the full paths to the associated documents, then on completion displays the following message (in Word 2003 the data file name will be MergeWithAttachmentsData.doc).:

Next prepare the covering message to accompany the documents:

Then click the button to complete the merge to Outlook:

The macro then prompts for a common subject for the e-mails:

Then a final OK sends the messages to Outlook.

Note: While testing at least, it is advisable to set the option in Outlook not to send the messages immediately