Kmahraz
Member
Hey Guys,
Looking for some help to change the code below from send email to Save as PDF.
Any help will be greatly appreciated.
Regards,
K
Looking for some help to change the code below from send email to Save as PDF.
Any help will be greatly appreciated.
Regards,
K
Code:
Sub SendEMail(WHOTOemail As String, myreport As String, myquery As String, mysubject As String, mytext As String)
On Error GoTo SendEMail_Err
Dim output As Long
DoCmd.OpenReport myreport, acViewReport, "", myquery, acNormal 'Open the report using the query defined above
DoCmd.OutputTo acOutputReport, myreport, "PDFFormat(*.pdf)", "C:\Users\krkoch\Desktop\& rs!WHOTO.pdf", False, "", , acExportQualityPrint
'DoCmd.SendObject acReport, myreport, "PDFFormat(*.pdf)", WHOTOemail, "", "", mysubject, mytext, False, ""
DoCmd.Close acReport, myreport
SendEMail_Exit:
Exit Sub
SendEMail_Err:
MsgBox Error$
Resume SendEMail_Exit
End Sub