Confirm Each Recipient in a New Outlook Mail Before it is Sent

  • Thread starter Thread starter Gruver
  • Start date Start date
Status
Not open for further replies.
G

Gruver

In Microsoft Outlook (2007) is there any way you can write code that will

present you with a message box asking you to confirm each of the recipients

in an e-mail after you click 'Send' and immediately before the e-mail is

dispatched to the server?

After I click on 'Send' I'd like to see a message box with something like

"Please confirm that you wish to send this e-mail to A and B and C (and that

you wish to copy X and Y and Z)". Ideally I'd like to see the names as they

appear in my address book i.e. 'John Doe' rather than

'jdoe@johndoeenterprises.com'.

The e-mail would only be sent after you confirmed the recipients by clicking

on the 'OK' button on the dialog box. If you clicked 'Cancel' you would be

returned to the e-mail and could then either add or remove recipients. The

message box would also prevent accidental sending (by mistakenly clicking the

'Send' button or by typing 'Alt+S').

I'm sure many would find the message box annoying but I would find it very

helpful. I know you can double-check the names in the address fields before

clicking Send (which I always do anyway) but there are times when a double

check would be very useful.

I've looked for some code to achieve this (I'm not entirely familiar with VB

in Outlook) and came across the code below which I think is trying to do

something very similar to what I want but I can't get it to work.

If anyone can point me in the right direction I'd be very appreciative.

http://blogs.technet.com/kclemson/archive/2004/01/02/47268.aspx

How about a simple confirmation message asking if you really want to send

it? You can do this by pasting the code below into your ThisOutlookSession

VBA module:

Option Explicit

Dim WithEvents objInspectors As Inspectors

Dim WithEvents objMyNewMail As MailItem

Private Sub Application_Startup()

Set objInspectors = Application.Inspectors

End Sub

Private Sub Application_Quit()

Set objInspectors = Nothing

Set objMyNewMail = Nothing

End Sub

Private Sub objInspectors_NewInspector(ByVal Inspector As Inspector)

If Inspector.CurrentItem.Class <> olMail Then Exit Sub

Set objMyNewMail = Inspector.CurrentItem

End Sub

Private Sub objMyNewMail_Send(Cancel As Boolean)

If MsgBox("Are you sure you want to send this message?", vbYesNo +

vbQuestion _

, "SEND CONFIRMATION") = vbNo Then

Cancel = True

End If

End Sub
 
You can simplify this task a lot by using just the Application.ItemSend

event:

Write code for the Application_ItemSend event handler, e.g.:

Private Sub Application_ItemSend _

(ByVal Item As Object, Cancel As Boolean)

Dim strMsg as String

strMsg = "To recipients = " & Item.To & vbCrLf & vbCrLf & _

"Cc recipients = " & Item.To & vbCrLf & vbCrLf & _

"Are you sure you want to send this message?"

If MsgBox(strMsg, vbYesNo + vbQuestion _

, "SEND CONFIRMATION") = vbNo Then

Cancel = True

End If

End Sub

Sue Mosher

"Gruver" <Gruver> wrote in message

news:35B04D5A-99E5-456F-9A70-AE696695BC27@microsoft.com...
> In Microsoft Outlook (2007) is there any way you can write code that will
> present you with a message box asking you to confirm each of the
> recipients
> in an e-mail after you click 'Send' and immediately before the e-mail is
> dispatched to the server?

> After I click on 'Send' I'd like to see a message box with something like
> "Please confirm that you wish to send this e-mail to A and B and C (and
> that
> you wish to copy X and Y and Z)". Ideally I'd like to see the names as
> they
> appear in my address book i.e. 'John Doe' rather than
> 'jdoe@johndoeenterprises.com'.

> The e-mail would only be sent after you confirmed the recipients by
> clicking
> on the 'OK' button on the dialog box. If you clicked 'Cancel' you would be
> returned to the e-mail and could then either add or remove recipients. The
> message box would also prevent accidental sending (by mistakenly clicking
> the
> 'Send' button or by typing 'Alt+S').

> I'm sure many would find the message box annoying but I would find it very
> helpful. I know you can double-check the names in the address fields
> before
> clicking Send (which I always do anyway) but there are times when a double
> check would be very useful.
 
Many thanks. I pasted the code into the ThisOutlookSession Object for the

ItemSend event but it didn't seem to do anything. Is there anything else that

I need to do?

"Sue Mosher [MVP]" wrote:


> You can simplify this task a lot by using just the Application.ItemSend
> event:

> Write code for the Application_ItemSend event handler, e.g.:

> Private Sub Application_ItemSend _
> (ByVal Item As Object, Cancel As Boolean)
> Dim strMsg as String
> strMsg = "To recipients = " & Item.To & vbCrLf & vbCrLf & _
> "Cc recipients = " & Item.To & vbCrLf & vbCrLf & _
> "Are you sure you want to send this message?"
> If MsgBox(strMsg, vbYesNo + vbQuestion _
> , "SEND CONFIRMATION") = vbNo Then
> Cancel = True
> End If
> End Sub

> > Sue Mosher
> > >

> "Gruver" <Gruver> wrote in message
> news:35B04D5A-99E5-456F-9A70-AE696695BC27@microsoft.com...
> > In Microsoft Outlook (2007) is there any way you can write code that will
> > present you with a message box asking you to confirm each of the
> > recipients
> > in an e-mail after you click 'Send' and immediately before the e-mail is
> > dispatched to the server?
> > After I click on 'Send' I'd like to see a message box with something like
> > "Please confirm that you wish to send this e-mail to A and B and C (and
> > that
> > you wish to copy X and Y and Z)". Ideally I'd like to see the names as
> > they
> > appear in my address book i.e. 'John Doe' rather than
> > 'jdoe@johndoeenterprises.com'.
> > The e-mail would only be sent after you confirmed the recipients by
> > clicking
> > on the 'OK' button on the dialog box. If you clicked 'Cancel' you would be
> > returned to the e-mail and could then either add or remove recipients. The
> > message box would also prevent accidental sending (by mistakenly clicking
> > the
> > 'Send' button or by typing 'Alt+S').
> > I'm sure many would find the message box annoying but I would find it very
> > helpful. I know you can double-check the names in the address fields
> > before
> > clicking Send (which I always do anyway) but there are times when a double
> > check would be very useful.


>
 
Does other VBA code run? Have you checked the basics at

http://outlookcode.com/article.aspx?id=49?

Sue Mosher

"Gruver" <Gruver> wrote in message

news:90183F60-5473-4269-955C-D39522AFCB35@microsoft.com...
> Many thanks. I pasted the code into the ThisOutlookSession Object for the
> ItemSend event but it didn't seem to do anything. Is there anything else
> that
> I need to do?

> "Sue Mosher [MVP]" wrote:
>
> > You can simplify this task a lot by using just the Application.ItemSend
> > event:
>

>> Write code for the Application_ItemSend event handler, e.g.:
>

>> Private Sub Application_ItemSend _
> > (ByVal Item As Object, Cancel As Boolean)
> > Dim strMsg as String
> > strMsg = "To recipients = " & Item.To & vbCrLf & vbCrLf & _
> > "Cc recipients = " & Item.To & vbCrLf & vbCrLf & _
> > "Are you sure you want to send this message?"
> > If MsgBox(strMsg, vbYesNo + vbQuestion _
> > , "SEND CONFIRMATION") = vbNo Then
> > Cancel = True
> > End If
> > End Sub
>

>> "Gruver" <Gruver> wrote in message
> > news:35B04D5A-99E5-456F-9A70-AE696695BC27@microsoft.com...
> > > In Microsoft Outlook (2007) is there any way you can write code that
> > > will
> > > present you with a message box asking you to confirm each of the
> > > recipients
> > > in an e-mail after you click 'Send' and immediately before the e-mail
> > > is
> > > dispatched to the server?
> >> > After I click on 'Send' I'd like to see a message box with something
> > > like
> > > "Please confirm that you wish to send this e-mail to A and B and C (and
> > > that
> > > you wish to copy X and Y and Z)". Ideally I'd like to see the names as
> > > they
> > > appear in my address book i.e. 'John Doe' rather than
> > > 'jdoe@johndoeenterprises.com'.
> >> > The e-mail would only be sent after you confirmed the recipients by
> > > clicking
> > > on the 'OK' button on the dialog box. If you clicked 'Cancel' you would
> > > be
> > > returned to the e-mail and could then either add or remove recipients.
> > > The
> > > message box would also prevent accidental sending (by mistakenly
> > > clicking
> > > the
> > > 'Send' button or by typing 'Alt+S').
> >> > I'm sure many would find the message box annoying but I would find it
> > > very
> > > helpful. I know you can double-check the names in the address fields
> > > before
> > > clicking Send (which I always do anyway) but there are times when a
> > > double
> > > check would be very useful.

>

>
>>
 
Perfect. I got it to work and that is exactly what I was looking for. Thank

you.

"Sue Mosher [MVP]" wrote:


> Does other VBA code run? Have you checked the basics at
> http://outlookcode.com/article.aspx?id=49?

> > Sue Mosher
> > >

> "Gruver" <Gruver> wrote in message
> news:90183F60-5473-4269-955C-D39522AFCB35@microsoft.com...
> > Many thanks. I pasted the code into the ThisOutlookSession Object for the
> > ItemSend event but it didn't seem to do anything. Is there anything else
> > that
> > I need to do?
> > "Sue Mosher [MVP]" wrote:
> >
> >> You can simplify this task a lot by using just the Application.ItemSend
> >> event:
> >
> >> Write code for the Application_ItemSend event handler, e.g.:
> >
> >> Private Sub Application_ItemSend _
> >> (ByVal Item As Object, Cancel As Boolean)
> >> Dim strMsg as String
> >> strMsg = "To recipients = " & Item.To & vbCrLf & vbCrLf & _
> >> "Cc recipients = " & Item.To & vbCrLf & vbCrLf & _
> >> "Are you sure you want to send this message?"
> >> If MsgBox(strMsg, vbYesNo + vbQuestion _
> >> , "SEND CONFIRMATION") = vbNo Then
> >> Cancel = True
> >> End If
> >> End Sub
> >
> >> "Gruver" <Gruver> wrote in message
> >> news:35B04D5A-99E5-456F-9A70-AE696695BC27@microsoft.com...
> >> > In Microsoft Outlook (2007) is there any way you can write code that
> >> > will
> >> > present you with a message box asking you to confirm each of the
> >> > recipients
> >> > in an e-mail after you click 'Send' and immediately before the e-mail
> >> > is
> >> > dispatched to the server?
> >> >> > After I click on 'Send' I'd like to see a message box with something
> >> > like
> >> > "Please confirm that you wish to send this e-mail to A and B and C (and
> >> > that
> >> > you wish to copy X and Y and Z)". Ideally I'd like to see the names as
> >> > they
> >> > appear in my address book i.e. 'John Doe' rather than
> >> > 'jdoe@johndoeenterprises.com'.
> >> >> > The e-mail would only be sent after you confirmed the recipients by
> >> > clicking
> >> > on the 'OK' button on the dialog box. If you clicked 'Cancel' you would
> >> > be
> >> > returned to the e-mail and could then either add or remove recipients.
> >> > The
> >> > message box would also prevent accidental sending (by mistakenly
> >> > clicking
> >> > the
> >> > 'Send' button or by typing 'Alt+S').
> >> >> > I'm sure many would find the message box annoying but I would find it
> >> > very
> >> > helpful. I know you can double-check the names in the address fields
> >> > before
> >> > clicking Send (which I always do anyway) but there are times when a
> >> > double
> >> > check would be very useful.
> >
> >
> >>


>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
G Confirm Each Recipient in a New Outlook Mail Before it is Sent Outlook VBA and Custom Forms 1
B Confirm before sending? Using Outlook 7
E Subscribing to another calendar when each party uses Office 365 Family Using Outlook 2
R Outlook 365 VBA AUTO SEND WITH DELAY FOR EACH EMAIL Outlook VBA and Custom Forms 0
S Outlook email to configure setup for each mail Outlook VBA and Custom Forms 1
T Pictures degrade each time an Outlook item is edited and re-saved Using Outlook 1
J Outlook 2016 After a search in all mailboxes, where is each message that was found? Using Outlook 6
L Cannot open PST file for first session each day Using Outlook 6
Hudas VBA find and open an email without looping thru each email in the inbox Outlook VBA and Custom Forms 1
K VBA to measure response time for each emails in a shared mailbox Outlook VBA and Custom Forms 11
B Saved emails in folders I created on left of screen are being erased as I open each folder Using Outlook 0
D How to forward each email x minutes after it arrives in inbox and hasn't been moved or deleted? Using Outlook 1
O "Pre-filled" text in each new message Using Outlook 2
I Different users connected to an IMAP email aren't syncing with each other Using Outlook 5
T VBA to process each email Outlook VBA and Custom Forms 10
M Outlook displays "choose folder" for each sent item. Using Outlook 2
T Setting Color codes for each user of a shared Calendar Using Outlook 1
C Exchange 2003 - Outlook 2003 - Calendar entries saving over each other Using Outlook 2
A Recurring meeting sending a invite for each meeting Using Outlook 1
H Re: record of sales for each contact BCM (Business Contact Manager) 1
C SQLDUMPER library does not turn on correctly when the computer isturned on each time. BCM (Business Contact Manager) 1
S ->[O2007] Parsing each line of a MailItem HTMLBody? Outlook VBA and Custom Forms 2
H For Each loop not getting all Email Items Outlook VBA and Custom Forms 3
S How to add icon(or picture) field for each contact in contacts view Outlook VBA and Custom Forms 6
F Graphics in email / Mac recipient garbled Using Outlook 0
T Outlook 2010 recipient no longer shows in 'Send To' Using Outlook 0
S Adding a recipient's column to Sent folder in Outlook 2010 Outlook VBA and Custom Forms 1
C Outlook 365 Copy/Save Emails in Folder Outside Outlook to Show Date Sender Recipient Subject in Header Using Outlook 0
C Automatically Insert Recipient Name from To Field Outlook VBA and Custom Forms 4
M Outlook, send to > mail recipient - results in plain text email Using Outlook 1
K Use VBA to find Sender and Recipient from Microsfot 365 Journaled Email Items Outlook VBA and Custom Forms 3
B VBScript doesn't run on Recipient Email Outlook VBA and Custom Forms 2
T "Words In Recipient's Address" Rule Causes Outlook To Stop Processing Rules Using Outlook 3
M ERROR: None of your email accounts could send to this recipient Using Outlook 2
N Custom Form Controls Not Visible To Recipient Outlook VBA and Custom Forms 3
Daniel Schunk User-defined form arrives empty at the recipient Using Outlook 3
B Looking to get the Recipient email address (or even the "friendly name") from an email I am replying to using VBA Outlook VBA and Custom Forms 4
D Moving Emails Based on Recipient/Sender Outlook VBA and Custom Forms 4
J Signatures that contain recipient's email address Outlook VBA and Custom Forms 7
broadbander Needing help with reply/reply all while keeping attachments and adding a new CC recipient. Outlook VBA and Custom Forms 5
L Automatically Insert Recipient Name from To Field Outlook VBA and Custom Forms 33
M recipient cache? Using Outlook 2
N Importing Google contacts from CSV file removes recipient names in autocomplete list Using Outlook 0
H How to show recipient email address? Using Outlook 0
R OL2010 - Send to Mail Recipient going to wrong account Using Outlook 1
J Searh For Recipient Email address Outlook VBA and Custom Forms 1
A Extracting only one recipient from Msgitem.To Outlook VBA and Custom Forms 7
Diane Poremsky Display the Recipient Email Address in the Sent Items Folder Using Outlook 0
E Meeting reminders are set for the recipient Exchange Server Administration 9
E Send a Reminder/Task to certain Email Recipient Using Outlook 5

Similar threads

Back
Top