Hi Experts,
I am conveting a access 2003 database to access 2007 and getting a lot of compile errors. I have fixed a few of the missing libraries and most seem to be ok. On the below sub I am getting a compile error on the Dim objMessage As MAPI.Message line. I am not sure what library etc these ovjects are referenced in. Any help would be great.
Public Sub EmailResultLog()
Dim objEmail As Outlook.MailItem
Dim objSafeEmail As Redemption.SafeMailItem
Dim nRecipient As Integer
Dim ar As Recordset
Dim nField As Integer
Dim sBody As String
Dim objField As Field
Dim objMessage As MAPI.Message
Set ar = CurrentDb.OpenRecordset("S
ELECT * FROM dbo_vwlogResultGet", dbOpenForwardOnly, dbReadOnly)
sBody = "Week Ending Refresh Generate Distribute<br>"
sBody = sBody & "----------- ------- -------- ----------<br>"
While Not ar.EOF
sBody = sBody _
& Format(ar!WeekEnding, "dd/mm/yyyy") & " " _
& IIf(IsNull(ar!Refresh), " ", IIf(ar!Refresh <> 0, " OK ", " Error ")) & " " _
& IIf(IsNull(ar!Generate), " ", IIf(ar!Generate <> 0, " OK ", " Error ")) _
& IIf(IsNull(ar!Distribute),
" ", IIf(ar!Distribute <> 0, " OK ", " Error ")) _
& "<br>"
ar.MoveNext
Wend
sBody = Replace(sBody, " ", " ")
ar.Close
Set objEmail = NewMailItem
objEmail.HTMLBody = "<font face=Courier size=2>" & sBody & "<font>"
Set objSafeEmail = New Redemption.SafeMailItem
objSafeEmail.Item = objEmail
Call LoadRecipients(objSafeEmai
l, "Result")
objSafeEmail.ReplyRecipien
ts.Add Params.EmailSender
objSafeEmail.Subject = "Frontline KPI Tracking: Result Log"
objSafeEmail.Send
Call DeliverNow
Set objEmail = Nothing
Set objSafeEmail = Nothing
End Sub
Start Free Trial