PC Review


Reply
Thread Tools Rate Thread

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

 
 
Gruver
Guest
Posts: n/a
 
      22nd Jul 2009
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 yopu 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
'(E-Mail Removed)'.

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/ar.../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
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      23rd Jul 2009
Eric's code looks OK, although by the time Application_Quit() fires any
Outlook objects are out of scope and can't be released in that event. I'd
just comment out that event handler entirely.

The code should work if you've enabled macros, what problem are you having
with it?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Gruver" <(E-Mail Removed)> wrote in message
news:B7C6B36D-7244-42B8-9394-(E-Mail Removed)...
> 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 yopu 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
> '(E-Mail Removed)'.
>
> 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/ar.../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


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Confirm Each Recipient in a New Outlook Mail Before it is Sent Gruver Microsoft Outlook VBA Programming 5 1 Week Ago 11:19 AM
File\Send To\Mail Recipient\Error using Outlook (Default) Mail Client gobanion Microsoft Outlook 1 27th Jun 2004 03:11 AM
Re: Sending e-mail to a distribution list. Can outlook send an individual e-mail to each recipient? Mr B Microsoft Outlook 0 1st Aug 2003 04:09 AM
Re: Sending e-mail to a distribution list. Can outlook send an individual e-mail to each recipient? Mr B Microsoft Outlook Discussion 0 1st Aug 2003 04:09 AM
Re: Sending e-mail to a distribution list. Can outlook send an individual e-mail to each recipient? Kristi Microsoft Outlook 0 1st Aug 2003 01:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:57 AM.