How to create an email with PDF attachment using 4TOPS Mail Merge


In this example we demonstrate the steps for making an email with a PDF invoice attached. We show how to create the mail merge templates for the PDF document and the email and the process that glues it all together. You will see that the creation of the PDF file is done by first creating a Word document and then having it automatically converted to a PDF document. Therefore, you will be editing the template for the PDF document in Word, which is convenient - you don't need a PDF editor.

Note: Before using the mail merge tool for PDF you have to prepare your situation to enable the PDF environment. How? See Preparing to work with PDF.

1. Use the mail merge wizard to set up the process

You always need to have the database open with the form or datasheet you want to use the information from. (You should have already installed the Mail Merge Addin. If not see Installation and connecting to your database .)

1.1 Open the data source (table, query or form)

1.2 Start the Mail Merge wizard

1.2.1 Select the Mail Merge Ribbon

1.2.2 Press the PDF Mail Merge button

mailmerge on the ribbon

This opens the Mail Merge wizard with the tab PDF pre-selected.

mailmerge process

1.3 Define the process

1.3.1 Select Email with PDF attachment

1.3.2 Give a process name. This will appear on the [process selection dialog], or accept the default.

1.3.3 In case of a a complex form with sub forms you have to choose whether you will select which form to iterate over -the overview or the instance. In case of a simple form this possibility isn't there.

1.3.4 Press <Next>

mailmerge process

1.4 On this tab you compose the email.

1.4.1 Select field containing the email address

1.4.2. Select a field containing some content for the subject line. This field also can have only text.

1.4.3 Create or use existing template. We select existing here because this example is long. You can see the full process of create a template based on an existing on create an email

1.4.4 Next

1.5 Edit the template for the attached PDF document.

You will be editing the template for the PDF document in Word, which is convenient - you don't need a PDF editor.

1.5.1 Only 'use existing...' if you can use it without editing. All the fields are in place. Else:

1.5.2 Give a filename for the PDF -template or accept the default. Select a file to base the new on or create an empty file by pressing 'create'.
More info on templates.

word mail merge pdf dialog mailmerge wizard

1.6 Continue after editing the template

mailmerge save process mailmerge process saved







The result you get later of this way of storing.

1.7 The store tab: skip this tab as you are going to specify the storage of the pdf-document on the PDF tab.

mailmerge store

1.8 The pdf tab: here you specify where you want to store the .pdf document.

1.8.1 Check if you want to automate file naming.

1.8.2 Check if you want to see the file before sending.

1.8.3 Specify the folder. Select a path, or use [field] names or a combination of it. Not already existing folders will be created automatically.

1.8.4 Specify the filename. Select a [field] name or type more [fields] or combine with functions.

1.8.5 Pressing 'Settings' gives the following dialog. Select the one you need. With Office 2007 you are advized to download and use 'MS Save as PDF add-in'.

Press 'OK'

mailmerge automatic naming 

1.8.6 Press 'Next'. Skip the Log-tab.

2. Start using the mail merge process you created

mail merge run

2.1. Press 'Run..' and evaluate the result with the selected data. OR

Press 'Open the Process Selection dialog' on the What's next dialog. The next time you will be using the 'Existing' button on the Mail Merge ribbon (Access 2003: menu Mail Merge > Open...).

The resulting Email:

email with pdf result

The resulting PDF-file

result word mail merge to pdf