T
Tim
My codes generate the error 287 at the objMail.Send. I think the path is
wrong, but I don't know why. If I use "On Error Resume Next" above the Send,
then there is no error popping up, but there is no email sent, either. Please
show me how to fix it. Thank you.
------
strDocName = "frmStud"
DoCmd.openfORM strDocName, acPreview, , "studId='" & glbStudId & "'"
FileName = strDocName & ".pdf"
DoCmd.OutputTo acOutputForm, strDocName, acFormatPDF,
"C:\Temp\StudentForms\" & FileName, False
‘==========================================
'Using Outlook programming codes ....
'==========================================
Dim objOutlook As Object
Dim objMail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.application")
Set objMail = objOutlook.CreateItem(olMailItem)
objMail.To = "(e-mail address removed)"
objMail.Subject = "test sending a form"
objMail.Attachments.Add "C:\Temp\StudentForms\" & FileName
'On Error Resume Next
objMail.Send
Set objOutlook = Nothing
wrong, but I don't know why. If I use "On Error Resume Next" above the Send,
then there is no error popping up, but there is no email sent, either. Please
show me how to fix it. Thank you.
------
strDocName = "frmStud"
DoCmd.openfORM strDocName, acPreview, , "studId='" & glbStudId & "'"
FileName = strDocName & ".pdf"
DoCmd.OutputTo acOutputForm, strDocName, acFormatPDF,
"C:\Temp\StudentForms\" & FileName, False
‘==========================================
'Using Outlook programming codes ....
'==========================================
Dim objOutlook As Object
Dim objMail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.application")
Set objMail = objOutlook.CreateItem(olMailItem)
objMail.To = "(e-mail address removed)"
objMail.Subject = "test sending a form"
objMail.Attachments.Add "C:\Temp\StudentForms\" & FileName
'On Error Resume Next
objMail.Send
Set objOutlook = Nothing