ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Special Action on E-Mail Error Condition (https://www.excelbanter.com/excel-programming/295931-special-action-e-mail-error-condition.html)

John Baker

Special Action on E-Mail Error Condition
 
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 ", "), _
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

Ron de Bruin

Special Action on E-Mail Error Condition
 
Try this

On Error Resume Next
ActiveWorkbook.SendMail ", "), _
messnamer
If Err.Number 0 Then
'your code
End If
On Error GoTo 0




--
Regards Ron de Bruin
http://www.rondebruin.nl


"John Baker" wrote in message ...
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 ", "), _
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




Ron de Bruin

Special Action on E-Mail Error Condition
 
Uuse the Err.Clear also

On Error Resume Next
ActiveWorkbook.SendMail ", "), _
messnamer
If Err.Number 0 Then
'your code
Err.Clear
End If
On Error GoTo 0


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ron de Bruin" wrote in message ...
Try this

On Error Resume Next
ActiveWorkbook.SendMail ", "), _
messnamer
If Err.Number 0 Then
'your code
End If
On Error GoTo 0




--
Regards Ron de Bruin
http://www.rondebruin.nl


"John Baker" wrote in message ...
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 ", "), _
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






John Baker

Special Action on E-Mail Error Condition
 
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

John Baker wrote:

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 ", "), _
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



Ron de Bruin

Special Action on E-Mail Error Condition
 
Hi John

Look here
http://www.rondebruin.nl/sendmail.htm#Prevent



--
Regards Ron de Bruin
http://www.rondebruin.nl


"John Baker" wrote in message ...
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

John Baker wrote:

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 ", "), _
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





John Baker

Special Action on E-Mail Error Condition
 
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


"Ron de Bruin" wrote:

Hi John

Look here
http://www.rondebruin.nl/sendmail.htm#Prevent



Ron de Bruin

Special Action on E-Mail Error Condition
 
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)


--
Regards Ron de Bruin
http://www.rondebruin.nl


"John Baker" wrote in message ...
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


"Ron de Bruin" wrote:

Hi John

Look here
http://www.rondebruin.nl/sendmail.htm#Prevent






All times are GMT +1. The time now is 02:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com