L
lil lam
Hi,
I recently learned how to create a module that sends an email to
inform users that the db is finished running.
I wanted to know, if it is possible to send this email with an
attachment.
If so, how?
Please help!!
Function email()
Dim objOut As Object
Dim objTask As Object
Dim blnCrt As Boolean
Dim iLimit As Long
Dim db As Database
Dim EmailAddy As Recordset
Dim tDate As Date
Dim CLEDMATCH As String
Set db = CurrentDb()
Set EmailAddy = db.OpenRecordset("tbl_EmailAddresses", dbOpenTable)
tDate = Format(Date, "mm/dd/yyyy")
'''OUTLOOK
On Error Resume Next
Set objOut = GetObject(, "Outlook.Application")
If objOut Is Nothing Then
Set objOut = CreateObject("Outlook.Application")
blnCrt = True
If objOut Is Nothing Then
MsgBox "Unable to start Outlook."
Exit Function
I recently learned how to create a module that sends an email to
inform users that the db is finished running.
I wanted to know, if it is possible to send this email with an
attachment.
If so, how?
Please help!!
Function email()
Dim objOut As Object
Dim objTask As Object
Dim blnCrt As Boolean
Dim iLimit As Long
Dim db As Database
Dim EmailAddy As Recordset
Dim tDate As Date
Dim CLEDMATCH As String
Set db = CurrentDb()
Set EmailAddy = db.OpenRecordset("tbl_EmailAddresses", dbOpenTable)
tDate = Format(Date, "mm/dd/yyyy")
'''OUTLOOK
On Error Resume Next
Set objOut = GetObject(, "Outlook.Application")
If objOut Is Nothing Then
Set objOut = CreateObject("Outlook.Application")
blnCrt = True
If objOut Is Nothing Then
MsgBox "Unable to start Outlook."
Exit Function