Report export from access to outlook body

syedadnan

Access Lover
Local time
Today, 19:13
Joined
Mar 27, 2013
Messages
315
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
 
Perhaps you could try approaching this from a different angle, what does the report contain? Maybe you could use the report source to populate the email body, how you'd go about this depends on what is in the report.

David
 

Users who are viewing this thread

Back
Top Bottom