Merge to email using only Outlook

Last reviewed on December 16, 2012

Over the last several weeks, several people asked if they could do a mail merge from Contacts to Outlook email directly. Yes, it is possible to insert contact data into an email message, merge style, although it's generally easier to merge to email using Microsoft Word's Mail Merge.

Your options are:

Use VBA to start a new email message and insert contact fields into the message. This works great for the subject field (and the To field). If you are inserting contact fields into the body, it works best if the message is short or the contact fields are added to the top of the message body. The deferred birthday greeting to contact code sample uses this method.

Create a template with bookmarks for the fields you want to use. The code sample below uses this method to merge a contact's data to a new message.

This screenshot shows the template and the merged email message.
email merge contact

Mail merge code sample

To use this code:

  1. Set macro security to low for testing.
  2. Download the template.
  3. Copy and paste the code into the VBA editor.
  4. Set a reference to Word object model in the VB Editor's Tools, References menu
  5. Make sure the path to the template is correct in the code.
  6. Select a contact in Outlook and run the macro.


Public Sub MailMergeNoWord()

If TypeName(ActiveExplorer.Selection.Item(1)) = "ContactItem" Then
 Set oContact = ActiveExplorer.Selection.Item(1)

Dim objItem As MailItem
Set objItem = Application.CreateItemFromTemplate("C:\path\to\template\bookmark-test.oft")
objItem.To = oContact.Email1Address
objItem.Subject = "This is the subject"
objItem.Display

'after the message is open and addressed to the contact, use reference word to put fields into bookmarks
    Dim objWord As Word.Application
    Dim objDoc As Word.Document
    Dim objSel As Word.Selection
    On Error Resume Next
    
'Set objItem = Application.ActiveInspector.CurrentItem
        If objItem.Class = olMail Then
            Set objInsp = objItem.GetInspector
                Set objDoc = objInsp.WordEditor
                Set objWord = objDoc.Application
                Set objSel = objWord.Selection
    
    
       'create a bookmark, repeat these two lines for each bookmark
        objSel.GoTo What:=wdGoToBookmark, Name:="name"
        objSel.TypeText Text:=oContact.FirstName
        
        objSel.GoTo What:=wdGoToBookmark, Name:="fullname"
        objSel.TypeText Text:=oContact.FirstName & " " & oContact.LastName
        
        objSel.GoTo What:=wdGoToBookmark, Name:="email"
        objSel.TypeText Text:=oContact.Email1Address

        objSel.GoTo What:=wdGoToBookmark, Name:="company"
        objSel.TypeText Text:=oContact.CompanyName
End If

Else
MsgBox "Sorry, you need to select a contact"
End If

    Set objItem = Nothing
    Set objSel = Nothing
    Set objWord = Nothing
    Set objInsp = Nothing

End Sub

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.