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 = "John.Doe@school.com"
objMail.Subject = "test sending a form"
objMail.Attachments.Add "C:\Temp\StudentForms\" & FileName
'On Error Resume Next
objMail.Send
Set objOutlook = Nothing
|
|
0
|
|
|
|
Reply
|
Utf
|
4/9/2010 2:51:01 PM |
|
Take a look at
http://www.devhut.net/index.php?lang=en&pid=0000000013#OutlookAuto
For a full Outlook automation function example which you can either simply
use or use to fix your code with.
--
Hope this helps,
Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
"Tim" wrote:
> 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 = "John.Doe@school.com"
> objMail.Subject = "test sending a form"
>
> objMail.Attachments.Add "C:\Temp\StudentForms\" & FileName
>
> 'On Error Resume Next
> objMail.Send
> Set objOutlook = Nothing
>
>
|
|
0
|
|
|
|
Reply
|
Utf
|
4/10/2010 2:38:01 PM
|
|
Hi Daniel, Thank you for the link, but for my program, it does NOT pop up the
Outlook security warning. The execution reaches "objMail.Send" code and then
jump down to these lines of codes
Err_Handler:
MsgBox Err.Description & " " & Err.Number
Where it describles the error message 287.
Do you think it's because of the configuration of the exchange
server/account? Thank you,
"Daniel Pineault" wrote:
> Take a look at
>
> http://www.devhut.net/index.php?lang=en&pid=0000000013#OutlookAuto
>
> For a full Outlook automation function example which you can either simply
> use or use to fix your code with.
> --
> Hope this helps,
>
> Daniel Pineault
> http://www.cardaconsultants.com/
> For Access Tips and Examples: http://www.devhut.net
> Please rate this post using the vote buttons if it was helpful.
>
>
>
> "Tim" wrote:
>
> > 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 = "John.Doe@school.com"
> > objMail.Subject = "test sending a form"
> >
> > objMail.Attachments.Add "C:\Temp\StudentForms\" & FileName
> >
> > 'On Error Resume Next
> > objMail.Send
> > Set objOutlook = Nothing
> >
> >
|
|
0
|
|
|
|
Reply
|
Utf
|
4/12/2010 6:55:01 PM
|
|
|
2 Replies
1879 Views
(page loaded in 0.154 seconds)
Similiar Articles: Application-Defined or Object-Defined error 287 - microsoft.public ...Hi Daniel, Thank you for the link, but for my program, it does NOT pop up the Outlook security warning. The execution reaches "objMail.Send" code and then jump down ... runtime error 2465: application-defined or object-defined error ...Where it describles the error message 287 ... Application-Defined or Object-Defined error 287 ... For a full Outlook ... Runtime Error 403: Class does not support ... Run time error 4003→what can I do ? - microsoft.public.vb ...... Run time error 40036 >> Application-defined or Object-defined error ... Application-Defined or Object-Defined error 287 - microsoft.public ... Run time error ... Automation Object Error Message - microsoft.public.access.forms ...Where it describles the error message 287 ... Application-Defined or Object-Defined error 287 ... For a full Outlook ... Runtime Error 403: Class does not support ... CreateObject("Outlook.Application") Error - microsoft ...Application-Defined or Object-Defined error 287 - microsoft.public ..... As Outlook.MailItem > > > > Set objOutlook = CreateObject("Outlook.application ... after the ... Oracle <CLOB> question - microsoft.public.excel.programming ...> > > error received in VBA: > > Run-time error '1004': > > Application-defined or object ... Application-Defined or Object-Defined error 287 - microsoft.public ... Oracle <CLOB ... compile error Only udts defined in public object modules can be ...compile error Only user-defined types defined in public object modules can be coerced to ... Error of "application-defined or object-defined error" ..... brackets ... Application error - microsoft.public.outlook.generalApplication-Defined or Object-Defined error 287 - microsoft.public ... Hi Daniel, Thank you for the link, but for my program, it does NOT pop up the Outlook security ... Excel.Application User-define Error - microsoft.public.access ...I have a user who uses a small excel file with a frontend, everytime the user opens the file they get " can not start. Error: Application-defined or object-defined error" problem sending email with vba - microsoft.public.access ...... have never quite managed to >memorise all the possible error numbers and their meanings! > Sorry It's error "287" Description "Application-defined or Object-defined error ... Answer : Application-Defined or Object-Defined error 287Hi Daniel, Thank you for the link, but for my program, it does NOT pop up the Outlook security warning. The execution reaches "objMail.Send" code and then Application-Defined or Object-Defined error 287 DataBaseMy codes generate the error 287 at the objMail.Send. I think the path is wrong, but I do not know why. If I use On Error Resume Next above the Send, then 8/1/2012 6:07:16 AM
|