I am trying to send an email to a distribution list that embeds three access reports. I am able to do this, but the reports come out as links instead of embedded objects. Can anyone help me figure out what I am doing wrong so that these reports will come out as objects embedded in the email, and not shortcuts to the messages on the server?
Here is my code...
Public Function createReports()
Dim filename1 As String, filename2 As String, filename3 As String
Dim d As Date
Dim datestr As String
d = Now()
datestr = CStr(d)
filename1 = "J:\RejectRepair\EntryStats.rtf"
filename2 = "J:\RejectRepair\ProcTypes.rtf"
filename3 = "J:\RejectRepair\DailyEncode.rtf"
DoCmd.OutputTo acOutputReport, "Entries Report by Time", acFormatRTF, filename1
DoCmd.OutputTo acOutputReport, "Process Types Report", acFormatRTF, filename2
DoCmd.OutputTo acOutputReport, "Power Encoded Daily Report", acFormatRTF, filename3
Dim appOutLook As Variant
Dim MailOutLook As Variant
Set appOutLook = CreateObject("Outlook.Application"
Set MailOutLook = appOutLook.CreateItem(olMailItem)
MailOutLook.Save
With MailOutLook
.To = distNames()
.Subject = "Daily Reject Statistics " & d
.Attachments.Add filename1, olByValue, 1, "EntryStats.rft"
.Attachments.Add filename2, olByValue, 1, "ProcTypes.rtf"
.Attachments.Add filename3, olByValue, 1, "DailyEncode.rtf"
.Display
End With
End Function
Here is my code...
Public Function createReports()
Dim filename1 As String, filename2 As String, filename3 As String
Dim d As Date
Dim datestr As String
d = Now()
datestr = CStr(d)
filename1 = "J:\RejectRepair\EntryStats.rtf"
filename2 = "J:\RejectRepair\ProcTypes.rtf"
filename3 = "J:\RejectRepair\DailyEncode.rtf"
DoCmd.OutputTo acOutputReport, "Entries Report by Time", acFormatRTF, filename1
DoCmd.OutputTo acOutputReport, "Process Types Report", acFormatRTF, filename2
DoCmd.OutputTo acOutputReport, "Power Encoded Daily Report", acFormatRTF, filename3
Dim appOutLook As Variant
Dim MailOutLook As Variant
Set appOutLook = CreateObject("Outlook.Application"
Set MailOutLook = appOutLook.CreateItem(olMailItem)
MailOutLook.Save
With MailOutLook
.To = distNames()
.Subject = "Daily Reject Statistics " & d
.Attachments.Add filename1, olByValue, 1, "EntryStats.rft"
.Attachments.Add filename2, olByValue, 1, "ProcTypes.rtf"
.Attachments.Add filename3, olByValue, 1, "DailyEncode.rtf"
.Display
End With
End Function