Controlling Ms Outlook from Access

  • Thread starter Thread starter Paul Donnelly
  • Start date Start date
P

Paul Donnelly

Hi Guys,

I am looking for help to get Access 2002 to open Ms
Outlook. With depending on which button I press in an
Access Form will have a different email address and topic.

Does anyone know an easy way to do this?

Many Thanks,
Pau
 
Here is some code you can put behind a command button that will show you how
to do this.

Dim oApp As Outlook.Application
Dim objNewMail As Outlook.MailItem

Set oApp = New Outlook.Application
Set objNewMail = oApp.CreateItem(olMailItem)
With objNewMail
.To = Me!EMailAddr
.Subject = "Put your subject here"
.Body = "Put your message here"
' If you are sending an attachment...
.Attachments.Add "Put your file name here"
.Save
.Send
End With

MsgBox "Finished sending email!"

Set oApp=Nothing

If all of your users are using the same version of Outlook as you, then use
early binding by setting a reference to the Microsoft Outlook xx.x Object
Library. If you have mixed versions of Outlook, then you will need to
investigate Late Binding, and here is a good link for that:

http://www.granite.ab.ca/access/latebinding.htm

hth,
 
Back
Top