Feedback from Outlook

R

RichardGarfield

After I have sent an email from Access through Outlook, I would like to get a
flag confirming that the email has been sent. I use this to lock a record but
do not want to lock if sending the email was aborted as, for example, when
someone answered no to one of the Security Warning.

Would appreciate your expert help.

Richard
 
D

Dale_Fye via AccessMonster.com

If you are using SendObject to send the email, then, there is a flag (Edit
Message) that you can set to true. This will cause the email to open for
editing. If the user cancels the email and does not send it, then this will
generate an error message (I think the number is 2501). You can trap for this
something like:

On Error Resume Next
Docmd.SendObject acSendNoObject,
docmd.SendObject acSendReport, "rptYourReport", , strTo, , , strSubject,
strBody, true
if err.Num = 0 then
'Set your flag to lock the record
elseif err.num = 2501 then
msgbox "Email was cancelled, record has not been locked!"
else
msgbox err.num & vbcrlf & err.description, vbOkOnly, "Error encountered"
endif
On Error Goto Error_Proc

HTH
Dale
 
R

RichardGarfield

Brilliant - many thanks Dale.

Although I am not using SendObject, I was able to adapt your solution and
works perfectly.

Richard
 

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