General Question

xBRIANx's avatar

How do you create a Microsoft Mail Merge document with attachments?

Asked by xBRIANx (242points) June 25th, 2009

I am familiar with merging text from a data souce like Excel. But I have attachments (PDFs) that I want to attached to the merged document based on X’s I’ve places in the column on the data source.

Observing members: 0 Composing members: 0

6 Answers

xBRIANx's avatar

comon experts.. where are you?

prasad's avatar

What attachment here means?
If it is embed (or link, you may use hyperlink also) object (in your case pdf file), you can do it from insert object.
Something has to be done if you want these files only for some records.
Or you want it send emails also?
Please explain your problem in more detail. I don’t know much, but I would definitely like to give it a try.

xBRIANx's avatar

Insert object? With a mail merge? I can’t to an e-mail merge because my data source does not include email addresses? Let me be more specific on the example:

Dear (insert name),
Please fill out the attached form, (insert name of form), and return it to us before August 1, 2009.

[Name, Form needed]
Adam, tax form
Beth, tax form
Chris, health form
Dave, tax form
Emily, health form
Fred, license form
Greg, health form
Herb, health form
Ira, tax form & license form

I have all the forms in PDF format. On the data source, I actually have the different forms in columns beside the names. I placed an “X” in the column beside their name. I want the form name to be filled in the blank in the letter with the form itself (pdf) attached to page #2 of the letter. Is this possible?

prasad's avatar

Alright, I can give you two options.
First, you can send your pdf (or whatever) files as email attachments. See merging with attachments. To make it work, open a word document, press alt + F11, select from menu Insert->Module and paste the code from the above linked website. Then, run this procedure (click anywhere in the code and press F5 key).
You’ll need outlook for this. This will send emails with attachments.

prasad's avatar

Second, you can embed pdf files into a word document (This will work same as when you copy a pdf file and paste special into the word document).
To understand the process, first see “how to add a different picture to every letter in a mail merge in word?”:
Similarly, you can insert pdf files into word document. However, the field code used here is “Link” (as a replacement for “IncludePicture” field code used in above linked website).

In Excel, follow these steps:

1. Open the Excel worksheet that you use as the mail merge data source.
2. Insert a new column that has a column heading such as pdf.
3. For each row of the Excel worksheet, insert in the pdf column the path and the file name of the picture that you want to use for that record of the data source. Additionally, enclose the path and the file name in quotation marks (”).
For example, copy the path and the file name of the picture in Windows Explorer. Then, paste the path and file name into the Excel worksheet.
Note The path and the file name of each picture in the Picture column will appear similar to the following example:
“C:\Documents and Settings\username\My Documents\My Pictures\foldername\filename.pdf”
4. On the Edit menu, click Replace (ctrl + H). Then, replace each instance of a single slash mark (\) with double slash marks (\\) in each path.
For example, each path should now look similar to the following example:
“C:\\Documents and Settings\\username\\My Documents\\My Pictures\\foldername\\filename.pdf”
Save and then close the Excel worksheet. Then, quit Excel.

In Word, follow these steps:

1. Open the mail merge main document.
2. If the Excel data source is not attached, attach the data source. To do this, go to Step 3 of 6 in the Mail Merge task pane. Click Browse, and then attach the Excel data source.
3. Click Next: Write your letter.
4. In the mail merge main document, move the insertion point to the location where you want the pdf to appear.
5. On the Insert menu, click Field (In word 2007, in insert on ribbon, in text section, in quick parts, click on Field).
6. In the Field dialog box, click Link under Field names, and then click OK.
Note You may receive the following error message:
Error! Filename not specified.
7. Press ALT+F9 to display the field codes in the mail merge main document. You will see a field that is similar to the following field:
{LINK AcroExch.Document.7}
8. Move the insertion point into the field immediately following Link AcroExch.Document.7.
9. Press the SPACEBAR, and then click More items on the Mail Merge task pane (insert your mail merge field, here pdf).
10. In the Insert Merge Field dialog box, click your merge field, such as pdf, and then click Insert.
11. Click Close to close the Insert Merge Field dialog box.

The LINK field should now look similar to the following field:
{LINK AcroExch.Document.7 {MERGEFIELD pdf}}
12. Press ALT+F9 to hide the field codes in the mail merge main document.

Note You can insert additional merge fields in the mail merge main document at this point.
13. Click Next: Preview your letters.
14. Click Next: Complete the merge (merge to new document).
15. In the Mail Merge task pane, click Edit individual letters.
16. In the Merge to New Document dialog box, click OK.
17. On the Edit menu in the merged document, click Select All (ctrl +A).
18. Press F9 to update the fields in the merged document.

The pdf files will now be embeded into the word document. You can double click on it to open it.


dbtrueheart's avatar

In regards to the second response from prasad:
Can merge fields be added to the pdf forms that you have just embedded into your mail merge?

Answer this question




to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
Knowledge Networking @ Fluther