Sending Access 2010 Report to message body in Outlook 2010

Middleground

New member
Local time
Yesterday, 21:13
Joined
Jun 27, 2014
Messages
2
Hello All,

This is my first post to this forum. I will try to meet all of the requirements for a proper post.

I have code in an Access 2010 database that sends a report as an HTML to an Outlook email message. I thought it worked great until I noticed that if the report is more than one page, it does not display all of the pages. There is a navigation option at the bottom of the message that is supposed to allow you to move to the second page but it does not appear to work.

My code is posted below. My question: Is there anyway to have all the pages appear in the body of the message?

Function exporthtml()
Dim strline, strHTML
Dim OL As Outlook.Application
Dim MyItem As Outlook.MailItem
Dim PTID As String
Set OL = New Outlook.Application
Set MyItem = Outlook.Application.CreateItem(olMailItem)

DoCmd.OutputTo acOutputReport, "rptBloodLabNotification", acFormatHTML, "c:\Blood Lab\Blood report.html"

Open "C:\Blood Lab\Blood report.html" For Input As 1
Do While Not EOF(1)
Input #1, strline
strHTML = strHTML & strline
Loop
Close 1
' If OL2002 set the BodyFormat
If Left(OL.Version, 2) = "10" Then
MyItem.BodyFormat = olFormatHTML
End If
MyItem.Subject = DCount("[Bx_Rcpt_Date]", "qrybloodlabnotification") & " " & "Biopsies Received"
MyItem.HTMLBody = strHTML
MyItem.Display

End Function

I would greatly appreciate your help!
 
Last edited by a moderator:

Users who are viewing this thread

Back
Top Bottom