Before sending a E-Mail...

T

Timur Zanagar

Hi folks,

If I click the "Sent" Button on a E-Mail I would like to receive a
Message Box which asks if I'm sure to sent this message.

Is this possible to realize? How should I do it?

Thank you very much in advance.
 
S

Sue Mosher [MVP-Outlook]

There is no such feature, but you can build it in with a little VBA code:

Private Sub Application_ItemSend _
(ByVal Item As Object, Cancel As Boolean)
Dim strMsg As String
Dim res As Long
strMsg = "Do you want to send the message?"
MsgBox strMsg, vbYesNo, "Send It?"
If res = vbNo Then
Cancel = True
Item.Display
End
End If
End Sub

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

Sorry, I was copying code from another snippet and forgot to change this statement

MsgBox strMsg, vbYesNo, "Send It?"


to

res = MsgBox(strMsg, vbYesNo, "Send It?")

so that you actually have a return value to work with.


--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Christian Goeller said:
Sue Mosher [MVP-Outlook], you wrote on Thu, 15 Sep 2005 14:50:38 -0400:
There is no such feature, but you can build it in with a little VBA code:

Private Sub Application_ItemSend _
(ByVal Item As Object, Cancel As Boolean)
Dim strMsg As String
Dim res As Long
strMsg = "Do you want to send the message?"
MsgBox strMsg, vbYesNo, "Send It?"
If res = vbNo Then
Cancel = True
Item.Display
End
End If
End Sub

I just sampled this code in OL 2003 SP1. The message box appears indeed,
but when I click "No" the mail will be send anyway...?!?

Best Regards
Christian Goeller
 
S

Sue Mosher [MVP-Outlook]

Sorry for the extra work. Cut and paste is an evil crutch.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Christian Goeller said:
Sue Mosher [MVP-Outlook], you wrote on Thu, 15 Sep 2005 22:28:09 -0400:
Sorry, I was copying code from another snippet and forgot to change this statement

MsgBox strMsg, vbYesNo, "Send It?"

to

res = MsgBox(strMsg, vbYesNo, "Send It?")

so that you actually have a return value to work with.

This behavior occurs anyway as long as the "End" between "Item.Display"
and "End If" exists. Deleting "End" makes this code working perfect!

[...]
strMsg = "Do you want to send the message?"
MsgBox strMsg, vbYesNo, "Send It?"
If res = vbNo Then
Cancel = True
Item.Display
End
End If
End Sub


--
Best Regards
Christian Goeller
Some misspellings, grammatical or linguistical mistakes found?
All corrections would be appreciated!
 
B

Brian Tillman

Timur Zanagar said:
If I click the "Sent" Button on a E-Mail I would like to receive a
Message Box which asks if I'm sure to sent this message.

Why would you click the Send button if you're not sure you wish to send it?
 
T

Timur Zanagar

It is not about clicking on the Send button. What about pressing Ctrl +
Enter or Alt + S while you writing a important mail and you're not
finished yet.

I think at least one time everybody just did it.
 
B

Brian Tillman

Timur Zanagar said:
It is not about clicking on the Send button. What about pressing Ctrl
+ Enter or Alt + S while you writing a important mail and you're not
finished yet.

Those don't seem to be key combinations that are easily pressed by accident,
at least to me.
 

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