Emailing Attached File with Mail Merge

T

Terry

I would like to do an email mail merge from a contact list in an Excel file
and include the same attachment (a PDF file) to each email. I use Outlook
(2007) for emails and more generally Office 2007.

I would like to insert the attachment only once. I cannot see a way to do
this during the mail merge process because the merge takes place in Word and
there does not seem to be a way to insert an attached file prior to the mail
merge. One has the Word menu system rather than the Outlook email menu in
which one can use insert/attach file to attach a file.

Is there any way to do this: to set up the email during mail merge so I
insert the attached file only once?
 
T

Terry

Thank you very much, Graham. Excellent advice.

I will probably go with the MAPILab add-in. I do use macros but I suspect
this one has a learning curve.

Please let me put in a recommendation to Mircosoft: the attachment
capability should be built into the Word/Outlook mail merge procedure, in a
simple box that allows the addition of an attachment.

Cheers,

Terry
 
G

Graham Mayor

There's not much of a learning curve with the MAPILabs tool and there is a
trial version I believe. It simply provides an extra menu item in the
mailmerge wizard and the ensuing dialog boxes are self evident.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Steve F

Graham,

PMFJI, but I'm working on a similar project and could use some assistance.

Both Doug Robbins macro and the MAPILabs tool build & send merge documents
to email -- no problem. However, I need the email message to look like the
original letter, including the header & footer in the original Word file
which contain corporate logos as images.

Any suggestions?
Thank,
Steve Frye
 
D

Doug Robbins - Word MVP on news.microsoft.com

Use the following macro in place of the one in the article of the Word MVP
site:

Sub emailmergewithattachments()
'To create the email messages in
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
Source.Sections(j).Range.Copy
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
.Subject = mysubject
.BodyFormat = olFormatHTML
.Display
Set objDoc = .GetInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
objSel.Paste
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


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
G

Graham Mayor

If you mean that you want the e-mail body to look like the letter then you
need to be aware that html format and Word document format have entirely
different formatting requirements e.g. html does not support header/footers
or even pages. You would need to create the 'letter' as an html document, to
which end Word's web view will give you more of a clue as to the resulting
layout.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top