Special Action on E-Mail Error Condition

  • Thread starter Thread starter John Baker
  • Start date Start date
J

John Baker

Hi:

I am setting up to E-mail something from excel through Outlook.

The code of interest is:
(messname is the name of the message)

ActiveWorkbook.SendMail Array("(e-mail address removed)", "(e-mail address removed)"), _
messname

The problem is that Outlook pops up a warning message that someone is trying to e-mail,
and asks for approval. If the user approves, thats fine but if they click NO the system
goes off into never never land.

I want to be able to detect that they have clicked no and take specific action to close
some files and tidy things up. My question is how do I do that?

Advice appreciated

John Baker
 
Try this

On Error Resume Next
ActiveWorkbook.SendMail Array("(e-mail address removed)", "(e-mail address removed)"), _
messnamer
If Err.Number > 0 Then
'your code
End If
On Error GoTo 0
 
Uuse the Err.Clear also

On Error Resume Next
ActiveWorkbook.SendMail Array("(e-mail address removed)", "(e-mail address removed)"), _
messnamer
If Err.Number > 0 Then
'your code
Err.Clear
End If
On Error GoTo 0
 
Thanks a lot.

Now an even more complicated question..is there some way that i can suppress the outlook
message in its entirety?

This would be particularly desirable since I am , under some circumstances, sending two
messages at the same time to different recipients -- and this means two calls.

Thanks

John
 
Ron:

Thanks. I guess you can only avoid it by changing settings in Outlook. I dont think my
clients would be willing to do that, so maybe I shall have to change my approach.
Showwarnings=False wont do It i guess.

Thanks

john
 
I guess you can only avoid it by changing settings in Outlook
In Outlook you can't do this, only in Outlook Express

Try the program Click Yes or use CDO(see the link on my site)
 

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

Back
Top