Email a report as body of email? (1 Viewer)

jeffm3434

Registered User.
Local time
Today, 06:16
Joined
Dec 2, 2005
Messages
21
Sorry if this has already been answered but I was unable to find it...

I have a button on a Form that I want to email a Report from. The problem is that the Report is always an attachment. Is there an easy way to make the report appear in the body instead of as attachment?

Here is what I currently have:

Code:
Private Sub Report_test_Click()
On Error GoTo Err_Report_test_Click

    Dim stDocName As String

    stDocName = "Sample Receipt Notification Report"
    DoCmd.SendObject acSendReport, stDocName, acFormatRTF, Me.Email, , , "MAS Sample Receipt Notification"
      
    
   
Exit_Report_test_Click:
    Exit Sub

Err_Report_test_Click:
    MsgBox Err.Description
    Resume Exit_Report_test_Click
    
End Sub

Thanks.
 

jeffm3434

Registered User.
Local time
Today, 06:16
Joined
Dec 2, 2005
Messages
21
Cool... I got it mostly working.

The loop of copying the data back into Outlook from my "report.html" file seems to loose some (not all) of the formatting. Like there are some spaces that get dropped and a comma or two.

EDIT: Just figured out the problem is only related to commas. The commas are getting dropped (and the following space) on the copying to the Outlook message. So word (like city and state that were separated by a comman are now completly run together... example: "City, State" becomes "CityState"

My html file has the commas but when read back in, they are not there.

My version of Outlook is version 11... so I did change that part of your code to check for version 11 instead of 10. Should something else change?
 
Last edited:

jeffm3434

Registered User.
Local time
Today, 06:16
Joined
Dec 2, 2005
Messages
21
Anybody know why the commas are getting dropped?

I've been researching and not found anything.

Thanks
 

Users who are viewing this thread

Top Bottom