Hi, I'm currently working on a database that allows users to email report as email content not attachment, it works except the conditional formatting is not showing, may I know whether it is possible? I got the code from the internet:
Code:
Sub RTFBodyX()
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Dim fs, f
Dim RTFBody, strTo
Dim MyApp As New Outlook.Application
Dim MyItem As Outlook.MailItem
DoCmd.OutputTo acOutputReport, "Statement", acFormatHTML, "Report1.htm"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("Report1.htm", ForReading)
RTFBody = f.ReadAll
f.Close
Set MyItem = MyApp.CreateItem(olMailItem)
With MyItem
.To = "a@b.c"
.Subject = "Subject"
.HTMLBody = RTFBody
End With
MyItem.Display
End Sub
Private Sub Command33_Click()
Call RTFBodyX
End Sub
Also, I note that anything after RTFBody
would not show in the email, please help as I wanted to put the report in the middle of the email content.
Thank you very much in advance!!