Automatic Email

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database that sends out a email to let me know a question has been
submitted.
Set myOlApp = CreateObject("Outlook. Application")
Set myemail = myOlApp.CreateItem(0)
With myemail
.subject = New Question
.To = strEmail
....
....
.send
End With
My question is, how can I get Access to open Outlook to send the email, if
the user doesn't have their Outlook opened.

Thanks,

G
 
Thanks for the quick response. I thought the CreateObject starts an instance
of Outlook, but why wouldn't the email be sent to my account in that case?
 
' you need to add Microsoft outlook ?? Object library

Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem

' Create the Outlook session.
Set objOutlook = New Outlook.Application

' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg
.Subject = "Subject"
.body = "message"
.Importance = olImportanceHigh
End with

Try this it works for me

Paul
 
Back
Top