A
ant1983
Hi Guyz,
I have a form (tblBooking subform1) (I know the naming is a mess!) - On that
form i have a button cmdEmailInvite which opens a report
rptTrainingConfirmation which runs off a query qryTrainingInvites.
Basically the cmdEmailInvite is a SendObject so sends that report to an
email as a pdf.
My problem is that i need other attachements on that email to and in another
post somene said Access cant attach external files to an email. Now firstly,
its not really an external file as the attachements i want attached are saved
in my database in another table as an attachemnt field type but anyway...
REgardless, i thought of another way to get around this.
I thought i could create Outlook Templates with my attachemnts saved in the
templates and then refer to that template in my code - would that work?
So i saved the template at the folowing location:
C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
Then i went to the code and changed it to:
Private Sub cmdEmailInvite_Click()
On Error GoTo Err_cmdEMailInvite_Click
Dim stDocName As String
stDocName = "Training Confirmation"
DoCmd.SendObject acReport, stDocName, acFormatPDF, txtEmail, "", "",
"Training Confirmation: " & txtCourse & " on " & dateStartDate & " to " &
dateEndDate, "Dear Delegate Blach Blah" , ,
C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
Exit_cmdEMailInvite_Click:
Exit Sub
Err_cmdEMailInvite_Click:
MsgBox Err.Description
Resume Exit_cmdEMailInvite_Click
End Sub
It doesnt work though. Brings up a "Compile Error - Syntax Error"
So basically my questions:
1 - Whats wrong with my code?
2 - Would the whole template idea work?
My 3rd question is basically if the above isnt possible. Somene said in
another post that i could use outlook automation. I have no idea what that
means - they referred me to
http://www.devhut.net/index.php?lang=en&pid=0000000013#OutlookAuto so...
3 - Where does that code go? on my command button or somewhere in Outlook?
Thanks a ton!
ant1983
I have a form (tblBooking subform1) (I know the naming is a mess!) - On that
form i have a button cmdEmailInvite which opens a report
rptTrainingConfirmation which runs off a query qryTrainingInvites.
Basically the cmdEmailInvite is a SendObject so sends that report to an
email as a pdf.
My problem is that i need other attachements on that email to and in another
post somene said Access cant attach external files to an email. Now firstly,
its not really an external file as the attachements i want attached are saved
in my database in another table as an attachemnt field type but anyway...
REgardless, i thought of another way to get around this.
I thought i could create Outlook Templates with my attachemnts saved in the
templates and then refer to that template in my code - would that work?
So i saved the template at the folowing location:
C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
Then i went to the code and changed it to:
Private Sub cmdEmailInvite_Click()
On Error GoTo Err_cmdEMailInvite_Click
Dim stDocName As String
stDocName = "Training Confirmation"
DoCmd.SendObject acReport, stDocName, acFormatPDF, txtEmail, "", "",
"Training Confirmation: " & txtCourse & " on " & dateStartDate & " to " &
dateEndDate, "Dear Delegate Blach Blah" , ,
C:\Users\Qbit - Wayne\Desktop\FNB Map and ISHCM Reading.oft
Exit_cmdEMailInvite_Click:
Exit Sub
Err_cmdEMailInvite_Click:
MsgBox Err.Description
Resume Exit_cmdEMailInvite_Click
End Sub
It doesnt work though. Brings up a "Compile Error - Syntax Error"
So basically my questions:
1 - Whats wrong with my code?
2 - Would the whole template idea work?
My 3rd question is basically if the above isnt possible. Somene said in
another post that i could use outlook automation. I have no idea what that
means - they referred me to
http://www.devhut.net/index.php?lang=en&pid=0000000013#OutlookAuto so...
3 - Where does that code go? on my command button or somewhere in Outlook?
Thanks a ton!
ant1983