How to email a mail merged word doc and mail merge the subject and the body of the email

Posted on 2009-02-08
Last Modified: 2013-12-02
I'm mail merging a word doc with MS Access.  Then when I hit the "finish and send" button
I choose "send email messages."  Now I choose "attachment" and I can type in
the subject and hit OK.

Now this works but the body of the email is blank.  What if I want to
do this but mail merge the subject line and mail merge the body of
the email message to make it more personal?

Question by:servent1
    LVL 1

    Accepted Solution

    The following code should work for you.

    I found it ages ago on the net so I cannot claim the rights to it but it certainly works

    Dim EmObj As Outlook.MailItem
    Dim MSObjOutlook As Outlook.Application

    Set MSObjOutlook = New Outlook.Application
    Set EmObj = MSObjOutlook.CreateItem(olMailItem)

    EmObj.To = Email address:
    EmObj.Subject = Subject
    EmObj.Body = ActiveDocument.Content
    EmObj.ReadReceiptRequested = True:

    Author Comment

    Thanks for the Reply.  Wow, what is that code?  Where does it go?
    Can you give more details please?

    LVL 1

    Expert Comment

    It is VBA.
    Have you not used it before.

    Are you sending email form Word using an Access database or opening Word from Access and emailing that way?

    I use Access and open Word and Outlook from Access, maybe not what you are looking for


    Author Comment

    Not familiar with VBA.  I'm opening word and using an Access db.
    LVL 1

    Expert Comment

    this is far more advanced than you are at present.

    Good Luck

    Author Comment

    I do have a BS in computer science about 25 years ago.  I always wanted
    to learn VBS but just don't have the time when trying to run my business.
    I found a program called at and works fairly well but
    cost $300.  Like to try to avoid paying that if I have to.
    Anyway, thanks for your time!

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
    Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) wo…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now