Send an email...

  • Thread starter Thread starter Guest
  • Start date Start date
1. In the Access VBA Editor (Alt-F11), select "Tools - References", then
check "Microsoft Outlook 9.0 Object Library".
2. Create the following procedure in a code module

Sub SendOutlookMail()
Dim objOL As Outlook.Application
Set objOL = CreateObject("Outlook.Application")

Dim msg As Outlook.MailItem
Set msg = objOL.CreateItem(olMailItem)

With msg
.To = "(e-mail address removed)"
.Subject = "Test"
.Body = "This is my message"
.Save
'Take a look at the saved message in your "Draft" folder first,
'to make sure all's well before uncommenting the next line
'.Send
End With

Set objOL = Nothing
Set msg = Nothing
End Sub

Hope this helps,
Klaus
 
Back
Top