Three questions about sending an email with Access and Outlook 200

G

Guest

I am using Office 2007 on two computers. I want to send an email from an
Access program via Outlook. On one computer I am successful. On the second
computer I fail. As far as I know the installations of Outlook and Access
on the machines are identical. (Obviously this is not true because of the
success/fail difference.)

My first question is: Instead of using Outlook, is there some other object
that I can use to send an email besides Outlook. My Access database
contains a table with a list of the email addresses. My email body is:
"See attached." and I attach a file to the email. An appropriate answer for
this question eliminates the second and third questions.

My second question is how can I get Outlook to cooperate with Access on my
second machine. On the successful machine I encounter two prompts during the
process. The first message begins: "A program is trying to access e-mail
message.... (Allow, Deny, Help) The second message begins A program is
trying to send an e-mail message ...... (Allow, Deny, Help)

On the successful machine I see these messages and respond appropriately in
order to send the email. On the second machine, I get an error message
regarding "The expression On Click......the following error: The expression
may not result in the name of........" OK. This message is in place of
Message #1. I never get to Message #2.

For both machines the code is identical and they both have a reference to
Outlook 12.0 Object Library.

The line of the crash (or Message #1) is the bottom line in this sequence
(non relavent code is eliminated)

Dim sAddress As String
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient

Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
Set objOutlookRecip = .Recipients.Add(sAddress)

A third question is: Is there a way to elimanate the prompts during the
code execution. It would streamline the operation and make it capable of
being automated.
 

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