S
Suaveboy
Guest
Hello all, I am trying to accomplish the following; I have a MS Access Form ( MS Access 2002) which has a botton used to send an email based on the current record on the form and I want to do two things at the same time if possible,
I want that when the user click on the "SEND EMAIL" botton, the system generates the email with the report as a PDF format. Right now I can generate the email using the following code;
Private Sub Email_Report_of_Current_Record__s__Click()
On Error GoTo Err_Email_Report_of_Current_Record__s__Click
Dim strReportName As String
Dim strCriteria As String
Dim stDocName As String
strReportName = "rpt_My_Report"
strCriteria = "[BusOwner]='" & Me![BusOwner] & "'"
stDocName = "rpt_My_Report"
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
DoCmd.SendObject acReport, stDocName, , strCriteria, , , "EMAIL SUBJECT", "EMAIL MSG"
Exit_Email_Report_of_Current_Record__s__:
Exit Sub
Err_Email_Report_of_Current_Record__s__Click:
MsgBox Err.Description
Resume Exit_Email_Report_of_Current_Record__s__
End Sub
However, I cannot seem to be able to
1.) send the report as a pdf file
2.) include another attachment within the same code so that everything happens at once. (like an instruction's document)
I know how to print to a PDF printer and how to attach a file in an email, but the purpose of automating is to have as few keystroke as possible and program the system to do what you what to do specially when you need to repeat the process over 100 times.
ANY ONE CARE TO ADVENTURE ON AN ANSWER?
P.S. I have seen some suggestions, but some do not work with Access 2002, others want you to buy Acrobat Wrtier and some have to be done through a module rather than embeding the code within a FORM botton.
My email is Chiqolate@hotmail.com if you care to discuss any further.
I want that when the user click on the "SEND EMAIL" botton, the system generates the email with the report as a PDF format. Right now I can generate the email using the following code;
Private Sub Email_Report_of_Current_Record__s__Click()
On Error GoTo Err_Email_Report_of_Current_Record__s__Click
Dim strReportName As String
Dim strCriteria As String
Dim stDocName As String
strReportName = "rpt_My_Report"
strCriteria = "[BusOwner]='" & Me![BusOwner] & "'"
stDocName = "rpt_My_Report"
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
DoCmd.SendObject acReport, stDocName, , strCriteria, , , "EMAIL SUBJECT", "EMAIL MSG"
Exit_Email_Report_of_Current_Record__s__:
Exit Sub
Err_Email_Report_of_Current_Record__s__Click:
MsgBox Err.Description
Resume Exit_Email_Report_of_Current_Record__s__
End Sub
However, I cannot seem to be able to
1.) send the report as a pdf file
2.) include another attachment within the same code so that everything happens at once. (like an instruction's document)
I know how to print to a PDF printer and how to attach a file in an email, but the purpose of automating is to have as few keystroke as possible and program the system to do what you what to do specially when you need to repeat the process over 100 times.
ANY ONE CARE TO ADVENTURE ON AN ANSWER?
P.S. I have seen some suggestions, but some do not work with Access 2002, others want you to buy Acrobat Wrtier and some have to be done through a module rather than embeding the code within a FORM botton.
My email is Chiqolate@hotmail.com if you care to discuss any further.