Regards,
I have copied a VBA from the net and it is working fine and producing my report on outlook body text but one problem me facing is that it is pasting only first page if the second page is there it is not coming in outlook text body this what i want rest every thing is correct the code is:
Private Sub Command88_Click()
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, "compliance", acFormatRTF, "compliance.rtf"
DoCmd.OutputTo acOutputReport, "compliance", acFormatHTML, "compliance.htm"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("compliance.htm", ForReading)
'Set f = fs.OpenTextFile("Report1.rtf", ForReading)
RTFBody = f.ReadAll
f.Close
Set MyItem = MyApp.CreateItem(olMailItem)
With MyItem
.To = "Ehmke66@email.com"
.CC = "Ehmke66@email.com"
.Subject = "Dispute Update"
.HTMLBody = RTFBody
End With
MyItem.Display
End Sub
I have copied a VBA from the net and it is working fine and producing my report on outlook body text but one problem me facing is that it is pasting only first page if the second page is there it is not coming in outlook text body this what i want rest every thing is correct the code is:
Private Sub Command88_Click()
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, "compliance", acFormatRTF, "compliance.rtf"
DoCmd.OutputTo acOutputReport, "compliance", acFormatHTML, "compliance.htm"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("compliance.htm", ForReading)
'Set f = fs.OpenTextFile("Report1.rtf", ForReading)
RTFBody = f.ReadAll
f.Close
Set MyItem = MyApp.CreateItem(olMailItem)
With MyItem
.To = "Ehmke66@email.com"
.CC = "Ehmke66@email.com"
.Subject = "Dispute Update"
.HTMLBody = RTFBody
End With
MyItem.Display
End Sub