Run-time error 287 Application-defined or object-defined error

G

Guest

I have a form that once submiited, it will send a email to me, letting me
know a issue has be submitted. The code follows...

Set objOutlook = Outlook.Application
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.subject = "New RFI Submitted"
.Importance = olImportanceHigh
.To = "(e-mail address removed)"
.Cc = "(e-mail address removed)"
.htmlbody = "<P><strong>RFI ID#:</strong> " & intRFIID &
"<BR><hr><strong>Originator:</strong> " & strOriginator & _
"<BR><hr><strong>Requested Resolution Response Time:</strong> "
& strR3T & "<BR><hr><strong>Issue:</strong> " & strDescription & _
"<BR><hr><strong>Primary Document Effected:</strong> " &
strPrimaryDocument & "<br><hr width=100%>If you have any questions or
comments concerning this RFI please contact " & _
"<br>" & strOriginator & " or <A
href='mailto:[email protected]'>[email protected]</A>."
.send
End With

A occurrence of Oulook is opened, allowing you to decide if you want to
automatically send email on your behalf. If you choose "No", you get a
Run-time error '287' Application-defined or object-defined error. The error
is at the .send when you try to debug. Is there a fix for this problem
anywhere.
 
G

Guest

You could put On Error Resume Next before the .send statement. If you want to
do something different if they cancelled, add:
If Err.Number= 287 Then
....
after the .send.

HTH,
Barry
 
G

Guest

Thanks for the help.

Barry Gilbert said:
You could put On Error Resume Next before the .send statement. If you want to
do something different if they cancelled, add:
If Err.Number= 287 Then
...
after the .send.

HTH,
Barry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top