How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Rojus Alappat Your Own Question

Rojus Alappat
Rojus Alappat, Computer Support Specialist
Category: Computer
Satisfied Customers: 512
Experience:  5+ Years of Experience as System Admin.
50059793
Type Your Computer Question Here...
Rojus Alappat is online now
A new question is answered every 9 seconds

In Word 2010, how can I attach a pdf document to a mail merge

Resolved Question:

In Word 2010, how can I attach a pdf document to a mail merge email? I'm running Windows 7, 64 bit.
Submitted: 3 years ago.
Category: Computer
Expert:  Rojus Alappat replied 3 years ago.
Hi... Welcome to Just Answer Support...
I am Rojus... Hope I can assist you to solve this issue...

Please go through the following steps...


Many to one mail merge

The mail merge function in Microsoft Word works only with a flat data file as a one to one merge. There have been various approaches proposed to enable the merging of lists associated with each record - for example invoices where multiple items appear associated with each buyer. Microsoft's own suggested approach is quite complicated and recorded at How to use mail merge to create a list sorted by category

Fellow Word MVP Paul Edstein has posted a tutorial on this, with working field codes and a sample Excel data source which you can download from this web site but it can be a tad bewildering and even Paul would concede that creating this type of merge can be intimidating for those unskilled in mail merge.

To overcome this difficulty another Antipodean MVP and regular contributor to this site, Doug Robbins produced an add-in to attempt to simplify the process, which I have modified and added some further functionality. This page documents the use of the add-in.

The add-in is supplied in DOTM format for Word 2007/2010 and includes a modification to the Mailings Tab of the ribbon.

The add-in requires that the data source used for the merge to be in Excel format with Outlook to be the default e-mail application for Windows.

Notes:

If there are likely to be some rows with no data in some of the fields, all of the cells that represent the data source must be formatted as text. Otherwise, errors can occur when the routine encounters a type of data that it is not expecting.

The data must be sorted by the field that is going to be used as the key field. Not sorting it that way will not cause an error, but the desired result will not be achieved.

The appropriate add-in should be should be extracted to the Word start-up folder. By default the start-up folder location is a hidden location, but it can easily be located by typing %appdata%\Microsoft\Word\Startup in the address bar of Windows Explorer or your browser. When Word is run the add-in will load and the calling command will be added to a custom toolbar or the mailings tab of the ribbon according to version.

MERGE MANY TO ONE

For the purpose of explanation of the use of the add-in, a ample merge document and an Excel data source are included in the zip file. An extract of the relevant part of the merge document is included below.

The merge document must be set up as a conventional letter merge.

While testing the e-mail option(s) with the sample data source, configure Outlook not to send messages immediately!

The sample messages will then go to the outbox from where they can be deleted.

With the example document, the key field is OWNER and the child fields are PROP_ID and LEGAL_DESC.

The fields are inserted as shown in the upper illustration and the intended result is shown in the lower illustration of the two illustrations that immediately follow. Note that only one set of each of the “repeating” fields (PROP_ID and LEGAL_DESC) is required in each location where that data may be reproduced.

The next step is to run the macro. The macro is designed to work in conjunction with Outlook as the default email application. If the merge is going to be as the body of a mail merge message, and you have Outlook configured to spell check messages before sending, Then you will see the following warning as each message is sent:

With a data file of more than a few records, this will soon become extremely tedious, so before progressing further, the macro checks the registry to establish whether the spell check option is selected. As it is not possible to disable the spell check using the macro, If it is selected you are presented with the following dialog, which provides the option to cancel and change the setting manually, or to continue without the option to merge to the body of an e-mail message.

Note:

When merging to the body of an e-mail message, be aware that the html format used bears little relationship to your Word merge document, as the formatting requirements for Word document and html are entirely different. Ensure that the layout of the messages is correct (see the Word web view) before sending.

If the data source is detached or is of the wrong type of file, or if the merge document type is wrong the user will be presented with a warning message that explains the error i.e.

If all is well the macro presents a userform from which the key field and the repeating fields are selected:

Messages merged to e-mail

An extract from one of the completed messages

An accompanying message

Expert:  Rojus Alappat replied 3 years ago.
While choosing the destination you should select df file instead of .dco file.

Hope this will help you... kindly let me know if you need further assistance...

1- Please click the ACCEPT button, so your deposit can be released and I can get paid for my effort. (*** Even if you have a subscription plan, you need to click the Accept button if the issue is solved for me to be paid, you won't be charged twice ***, don't worry. Thank you!)

2- Let me know if the answer doesn't work INSTEAD of leaving negative feedback, so we can still continue troubleshooting the issue.

3- Positive Feedback is very important to us. Please leave me a positive feedback if you are happy with the answer.

4- Any bonus will be greatly appreciated.
Customer: replied 3 years ago.
Dear Rojus,
I think I understand what you have. I do not have any problems setting up and sending multiple emails from Word 2010. My question is, how can I add an attachment to the separate emails. Please help.

Glen
Expert:  Rojus Alappat replied 3 years ago.
Can you please try the following to merge with attachments...

Mail Merge to E-mail with Attachments

This procedure can be used to mail merge to e-mail, including attachments with each message when Microsoft Office Outlook is installed. It has been used with all versions of Office from Office 97 up to and including Office 2007. It is not necessary for Outlook to be nominated as the default mail program, but it must be installed on the system. The procedure can handle multiple attachments for each message, individual attachments for each recipient, common attachments for all recipients, or a mixture of both.

Preparations

To run the macro in this procedure it is necessary to set a reference to the Microsoft Office Outlook Object Library. You do this from within the Visual Basic Editor, by selecting References from the Tool menu and then checking the item Microsoft Office Outlook ##.0 Object Library (where ## XXXXX XXXXX Outlook version number).

In addition, running the macro will cause the following warning message to be displayed by Outlook for each email message that the macro sends:

Warning that other program is attempting to send an email

You can avoid this happening by downloading the "Express ClickYes" utility that is available as a free download from:

http://www.contextmagic.com/express-clickyes/

Express ClickYes is a tiny program that sits in the taskbar and clicks the Yes button on behalf of you, when Outlook's Security Guard opens prompt dialog saying that a program is trying to send an email with Outlook or access its address book. You can suspend/resume it by double-clicking its taskbar icon. Developers can automate its behaviour by sending special messages.

Setup

You will need to create a separate Catalog (or in Word 2002 and later, Directory) type mail merge main document which creates a word document containing a table in each row of which would be data from the data source that contains the email address in the first column and the Drive:\Path\Filename of each attachment in the second and any subsequent columns, one attachment per cell.

The data source for this Catalog/Directory type mail merge must be the same data source as that which you have, or will use for creating the mail merge that you want to email with attachments.

I cannot emphasise too strongly that the path and filenames for the attachments must be IDENTICAL to the actual path and filenames. If they are not, the files will not be attached. A single space in the wrong place is all that it will take for the procedure to fail.

In the Catalog/Directory type mail merge main document, insert a one row table into the cells of which you insert the relevant merge fields from the data source, similar to the following:

<<EmailAddress>>

<<Attachment1>>

<<Attachment2>>

If the same attachment(s) are to be sent to all of the recipients, and they are not included in the datasource, the Drive\Path\Filename of the attachment(s) can be typed directly in the cell(s) of the Catalogue/Directory mail merge main document in place of the <<Attachment>> fields. In this case, your main document would look like:

<<EmailAddress>>

D:\Documents\JulyReport.doc

You can also have a mixture of a standard attachment for each recipient and an individual one by setting the main document up in the following fashion:

<<EmailAddress>>

D:\Documents\JulyReport.doc

<<Attachment2>>

After creating this Catalog/Directory mail merge main document, execute the mail merge to a new document, which if you have set it up correctly will produce a document containing a table similar to the following with as many rows as there are records in the data source:

XXX@XXXXXX.XXX

D:\mugshots\billsmith.jpg

D:\resumes\billsmith.doc

XXX@XXXXXX.XXX

D:\mugshots\jowblow.jpg

D:\resumes\joeblow.doc

Or in the case of a common attachment for each recipient:

XXX@XXXXXX.XXX

D:\Documents\JulyReport.doc

XXX@XXXXXX.XXX

D:\Documents\JulyReport.doc

Save that file and close it. When you run the macro that is provided below, you will be asked to open that document, so remember the name that you have given to it and where you saved it.

Then execute to a new document the mail merge that you want to send out by email with the attachments and with the result of the execution of that mail merge on the screen, run a macro containing the following code. (This code is designed to be pasted into the VBA Editor: it is much easier to read if you do that!)

Sub emailmergewithattachments() Dim Source As Document, Maillist As Document, TempDoc As Document
Dim Datarange As Range
Dim i As Long, j As Long
Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
Dim mysubject As String, message As String, title As String Set Source = ActiveDocument ' Check if Outlook is running. If it is not, start Outlook
On Error Resume Next
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If ' Open the catalog mailmerge document
With Dialogs(wdDialogFileOpen)
.Show
End With
Set Maillist = ActiveDocument ' Show an input box asking the user for the subject to be inserted into the email messages
message = "Enter the subject to be used for each email message." ' Set prompt.
title = " Email Subject Input" ' Set title.
' Display message, title
mysubject = InputBox(message, title) ' Iterate through the Sections of the Source document and the rows of the catalog mailmerge document,
' extracting the information to be included in each email.
For j = 1 To Source.Sections.Count - 1
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
.Subject = mysubject
.Body = Source.Sections(j).Range.Text
Set Datarange = Maillist.Tables(1).Cell(j, 1).Range
Datarange.End = Datarange.End - 1
.To = Datarange
For i = 2 To Maillist.Tables(1).Columns.Count
Set Datarange = Maillist.Tables(1).Cell(j, i).Range
Datarange.End = Datarange.End - 1
.Attachments.Add Trim(Datarange.Text), olByValue, 1
Next i
.Send
End With
Set oItem = Nothing
Next j
Maillist.Close wdDoNotSaveChanges ' Close Outlook if it was started by this macro.
If bStarted Then
oOutlookApp.Quit
End If MsgBox Source.Sections.Count - 1 & " messages have been sent." 'Clean up
Set oOutlookApp = Nothing End Sub

If you are not sure what to do with the above code, see the article "What do I do with macros sent to me by other newsgroup readers to help me out?” at:

http://www.word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm
Rojus Alappat, Computer Support Specialist
Category: Computer
Satisfied Customers: 512
Experience: 5+ Years of Experience as System Admin.
Rojus Alappat and 11 other Computer Specialists are ready to help you
Customer: replied 3 years ago.
Yes, I saw this article on the web, but it is way more complicated than I want to deal with. However, I will accept the answer, I just wish it had been more helpful.

Thank You, Glen
Expert:  Rojus Alappat replied 3 years ago.
Thanks for the accept... Please dont forget to leave a positive feedbac too...
You can contact me through just answer in the future too...

Thanks again...
Customer: replied 3 years ago.
I have pushed the accept answer button, more than once. I hope I'm not to be charged more than the one time. Please take care of this. Thank you.

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
< Last | Next >
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
  • I am very happy with my very fast response. Eric is very knowledgeable in the subject area. Thank you! RP Austin, TX
  • Hi John, Thank you for your expertise and, more important, for your kindness because they make me, almost, look forward to my next computer problem. After the next problem comes, I'll be delighted to correspond again with you. I'm told that I excel at programing. But system administration has never been one of my talents. So it's great to have an expert to rely on when the computer decides to stump me. God bless, Bill Bill M. Schenectady, New York
  • The Expert answered my Mac question and was patient. He answered in a thorough and timely manner, keeping the response on a level that could understand. Thank you! Frank Canada
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
 
 
 

Meet The Experts:

 
 
 
  • Andy

    Computer Consultant

    Satisfied Customers:

    5311
    11yr exp, Comp Engg, Internet expert, Web developer, SEO
< Last | Next >
  • http://ww2.justanswer.com/uploads/EN/Engineer1010/2012-6-9_132423_jaj12a.64x64.jpg Andy's Avatar

    Andy

    Computer Consultant

    Satisfied Customers:

    5311
    11yr exp, Comp Engg, Internet expert, Web developer, SEO
  • http://ww2.justanswer.com/uploads/BA/barrenrock/2011-10-19_215925_JamesJAFinal.64x64.jpg James's Avatar

    James

    Sr. Computer Support Expert

    Satisfied Customers:

    8376
    20 years of experience building, fixing and servicing PCs and operating systems.
  • http://ww2.justanswer.com/uploads/zeyank/2009-09-26_154244_P8110079.png Ryan H.'s Avatar

    Ryan H.

    Computer Support Specialist

    Satisfied Customers:

    1741
    A+ Certified Technician - 10 Years experience working with all types of computer systems.
  • http://ww2.justanswer.com/uploads/JA/jadedangel57/2011-11-8_193134_janenewsm.64x64.jpg Jane Lefler's Avatar

    Jane Lefler

    Sr Prog Analyst / Technician

    Satisfied Customers:

    0
    Computer Programmer / Technician/ Consultant 16+ years
  • http://ww2.justanswer.com/uploads/RO/robmpreston/2013-9-23_233814_mijiFZm.64x64.jpg RPI Solutions's Avatar

    RPI Solutions

    Support Specialist

    Satisfied Customers:

    3476
    5+ Years in IT, BS in Computer Science
  • http://ww2.justanswer.com/uploads/BA/barunrath/2012-7-5_201954_Profilepic2.64x64.jpg B. Rath's Avatar

    B. Rath

    Computer Support Specialist

    Satisfied Customers:

    8671
    Certified Computer/Networking Support Specialist.
  • http://ww2.justanswer.com/uploads/FS/fszcze/2012-6-18_181848_500test.64x64.jpg Frederick S.'s Avatar

    Frederick S.

    Computer Specialist

    Satisfied Customers:

    7240
    Computer technician and founder of a home PC repair company.