How to send a e-mailshot programmatically

J

Jon Lewis

I'm trying to code a routine in VBA from Access to send a standard e-mail to
a group of clients. However, I can't figure out how to have standard
content in the body of the message.

If I manually create a new message with the required content (could be text
graphics or both) and then save the message as an Outlook Template (oft
file) , I can choose File>New>Choose Form>User Templates in File System...
and pick my saved oft file I get my required contect in the message body as
required.

How do I replicate this with Automation?

If I use the CreateItemFromTemplate method,
(Set objOutlookMsg = objOutlook.CreateItemFromTemplate(strTemplate))
in the resultant message created, the text in the message body of my saved
template does not appear at all and the graphical objects don't appear in
the body but may or may not appear as attachments acording to their
object/file type. (I'm setting the OlBodyFormat to olFormatHTML BTW)

Should I be using another method?

Also is there any way through Automation to handled of the "A program is
trying to access e-mail addresses..." Outlook security dialog which appears
3 times per email created if objOutlookMsg.Save and objOutlookMsg.Send are
used.

TIA
 
S

Sue Mosher [MVP-Outlook]

I'd probably try doing this by automated Word's mail merge and using a Word document, not an Outlook template. If you set the mail merge output format to Email-HTML, you shouldn't get a security prompt for each send.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
J

Jon Lewis

Thanks Sue,

Sorry for the delay in replying. I really want to try to do this from
Outllok as I need to support a variety of systems and I don't think that
Mail Merge Output Format is available in older Word versions.

I've tried to get results copying the Source of a saved HTM doc to the
HTMLBody property of the MailItem. Sometimes I get the X symbol in the body
(view source indicates that the HTML text is the same), sometimes I get
nothing.

Any idea why?

TIA
I'd probably try doing this by automated Word's mail merge and using a Word
document, not an Outlook template. If you set the mail merge output format
to Email-HTML, you shouldn't get a security prompt for each send.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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