Hi everyone,
I have coded a button that creates a pdf file from a Report with DoCmd.OutputTo
The issue I have is that I want to attach this new file to an Outlook email; Does somebody knows how?
This below is my code
Your support is highly appreciated!!!
**********************
Dim stDocName As String
Dim stReportName As String
Dim stFileName As String
stDocName = "Diagram"
stReportName = "Diagram AB "
stFileName = CurrentProject.Path & "" & stReportName & Me.ID & ".pdf" 'set the file name for the new PDF
DoCmd.OutputTo acOutputReport, stDocName, acFormatPDF, stFileName, True 'HOW Can I attach this to Outlook automatically?
DoCmd.SendObject acSendReport, stDocName, acFormatPDF, , , , "NC Report: " & Me.ID, "NC Report with ID: " & Me.ID
End Sub