Briain ha scritto:
Is there a possible way to eliminate my 2 step process of creating reports in
MS Access, and then attaching them to Outlook email templates?
Thanks
Of course.
Osing SendObject method you use dhe default MailBrowser, but you need
to transform the Report on a SnapShots
DoCmd.SendObject acSendReport, stDocName,"Snapshot Format" [, to][,
cc][, bcc][, subject][, body]
This one require that the receiver have SnapshotsViewer on its
machine..... it's not so easy....!
Is much better print like PDF on a Virtual printer and send the
attachment/s
You do not specifie if Outlook is OE or MSO...?
In 2° case you can use also Automation
Sub SendMailAutomation()
Dim Ol_App As New Outlook.Application
Dim Ol_Item As Outlook.MailItem
Set Ol_Item = Ol_App.CreateItem(olMailItem)
With Ol_Item
.To = "(e-mail address removed)"
.subject = "Objet message"
.Body = "Body message"
.Attachments.Add "C:\PrintedReport.pdf"
' if you need to store on a SentItems
.Save
.send
End With
Set Ol_Item = Nothing
Set Ol_App = Nothing
End Sub
Also is possible to use MAPI or CDO...... or Winsock.....
Bye
@Alex