Hello, I have a report that is generated in access. When a user clicks a button, an email opens up and i want this report to be part of the attachment. I found this code, but it opens up a separate email with the attached report. How do i get it to appear on the first email?
code i use to add attachment but opens up in separate email screen:
DoCmd.SendObject acSendReport, "report", acFormatHTML
Code i have to open up email with body information in it:
Dim strEMail As String
Dim oOutlook As Object
Dim oMail As Object
Dim strAddr As String
Dim MyDB As DAO.Database
Dim rstEMail As DAO.Recordset
Set oOutlook = CreateObject("Outlook.Application")
Set oMail = oOutlook.CreateItem(0)
With oMail
.HTMLBody = "<HTML><body>" & _
"Hi, "
.Display
End With
So the idea is to incorporate the attached report into the second half of the code i provided.
Thanks!