Add attachments and set email fields during a mail merge to email

Last reviewed on November 2, 2012

If you want to set certain Outlook fields when you do a mail merge, you need to use an ItemSend rule.

To use, open the VBA Editor using Alt+F11 and expand Project1 until you see ThisOutlookSession. Double click on ThisOutlookSession and paste the macro in the right pane.

Change mail merge subject to match all or part of the subject, otherwise all mail you send will be marked important and have a reminder set. Change the reminder date and time.

Recipients may have rules to remove the reminder, flag, and Importance fields.


Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

If InStr(LCase(Item.Subject), "mail merge subject") Then

With Item
      .Importance = olImportanceHigh
      .ReminderSet = True
      .ReminderTime = #10/30/2012 8:00:00 AM#
      .FlagRequest = "Please reply by 10/30"

' to add an attachment, enter the path & name here
     .Attachments.Add "D:\For merge\filename.docx"
End With
  End If
End Sub

If you want to use a different attachment for each person, you'll need to use attachments that are the same name as a message field - the To field will probably be the easiest, although prone to problems. ("To" is the display name, not the email address.)

Item.Attachments.Add "D:\For merge\" & Item.To & ".docx"

Or use one of the utilities listed at Using Mail Merge in Outlook

Written by

Diane Poremsky
A Microsoft Outlook Most Valuable Professional (MVP) since 1999 and involved in IT support since 1985, Diane is the author of several books and video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.