espinosalex
Programmer
I am working in MS Access 2000. I want to be able to put a report in the body of an email, not attach it. Anyone have any ideas?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub RTFBody()
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Dim fs, f
Dim RTFBody, strTo
Dim MyApp As New outlook.Application
Dim MyItem As outlook.MailItem
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("C:\\Report.rtf", ForReading)
RTFBody = f.readall
f.Close
Set MyItem = MyApp.CreateItem(olMailItem)
With MyItem
.To = "me@hotmail.com"
.Subject = "txtSubjectLine"
.Body = RTFBody
End With
MyItem.Display
End Sub