Autmating Mailmerge

L

Lezzo

Note: I mistakingly posted this message in Getting
started as well!

I would like to know if it is possible to automate the
following steps using Access 97. I have a Mail Merge
document that is using an access tabel as a data source.
Every day one of our users need to send this document to
different recipients. The process is now done manually by
doing the following steps:

1. Open the Mail Merge document.
2. Start Mailmerge
3. Merge to Electronic Mail
4. Click on Setup|Merge to Setup.
5. In Data field with Mail/Fax Address the field
EMail is selected which contains the e-mail address
of the recipient.
6. In Mail Message Subject line we enter "Reminder".
7. Select Send Document as Attachment.
8. Select O.K. and Merge.

As you can see a lot of steps need to be done to send
this mailmerge as an attachment to a recipient.
So I'm wondering whether these steps could be automated
using Access 97. Any hints or tips are most appreciated.

TIA. - Lezzo.
 
L

Lezzo

I have found the solution, by writing the following
routine in Access 97:

Set oApp = CreateObject("Word.Application")
oApp.Application.Visible = True
oApp.Application.Documents.Open "\\brussfmc1
\applications\JAS\FMC\MailMerges\1streminder.doc"

With oApp.ActiveDocument.MailMerge
.Destination = wdSendToEmail
.MailAsAttachment = True
.MailAddressFieldName = "EMail"
.MailSubject = "Outstanding Bill - Double-Click
on Attachment to Open."
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
oApp.ActiveDocument.Close
oApp.Quit
Set oApp = Nothing


The only thing that I would like to do is to be able to
send text to the Body of my e-mail item that is sent to
the recipient, I have looked for the property named
MailBody but that does not seems to exists, so any help
on that is most appreciated! TIA!

Lezzo.
 

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