Checking Recipient Group before sending email via VBA

Discussion in 'Microsoft Outlook VBA Programming' started by Gurvinder, Oct 26, 2010.

  1. Gurvinder

    Gurvinder Guest

    Is there any way to check via VBA if the recipient is a specific group
    or keywords before sending any email to bring up a pop-up saying "Are
    you sure you want to send this message to a group"

    Saving you lapse in picking the wrong group to send emails to.

    Outlook 2007 - Exchange 2003.

    Thanks in advance.
     
    Gurvinder, Oct 26, 2010
    #1
    1. Advertisements

  2. Gurvinder

    Ken Slovak Guest

    What sort of group? Do you mean an Outlook distribution list, or one in an
    Exchange GAL, or ...?

    It would also depend on whether or not a distribution list, if that's what
    you are talking about, is expanded or not.

    What about keywords? Do you mean categories, or what? Please explain.

    --
    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


    "Gurvinder" <> wrote in message
    news:...
    > Is there any way to check via VBA if the recipient is a specific group
    > or keywords before sending any email to bring up a pop-up saying "Are
    > you sure you want to send this message to a group"
    >
    > Saving you lapse in picking the wrong group to send emails to.
    >
    > Outlook 2007 - Exchange 2003.
    >
    > Thanks in advance.
     
    Ken Slovak, Oct 26, 2010
    #2
    1. Advertisements

  3. Gurvinder

    Jay Brigand Guest

    Re: What sort of group?

    Hi,

    I'm actually looking to set up something similar.

    Ideally, I want to get something set up so that if I write an email and address it to the Distribution Group "All Users" it will come up with a pop up asking me to confirm if I want to send it with a yes or no button.

    Ideally, it would be something similar to the below code but for checking if it is being sent to the distribution list instead of having an attachment:

    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    '
    If InStr(1, Item.Body, "attach", vbTextCompare) > 0 Then
    If Item.Attachments.Count = 0 Then
    ans = MsgBox("There's no attachment, send anyway?", vbYesNo)
    If ans = vbNo Then Cancel = True
    End If
    End If
    End Sub

    Any help would be greately appreciated.
    - J

    > On Tuesday, October 26, 2010 2:43 PM Gurvinder wrote:


    > Is there any way to check via VBA if the recipient is a specific group
    > or keywords before sending any email to bring up a pop-up saying "Are
    > you sure you want to send this message to a group"
    >
    > Saving you lapse in picking the wrong group to send emails to.
    >
    > Outlook 2007 - Exchange 2003.
    >
    > Thanks in advance.



    >> On Tuesday, October 26, 2010 6:27 PM Ken Slovak wrote:


    >> What sort of group? Do you mean an Outlook distribution list, or one in an
    >> Exchange GAL, or ...?
    >>
    >> It would also depend on whether or not a distribution list, if that is what
    >> you are talking about, is expanded or not.
    >>
    >> What about keywords? Do you mean categories, or what? Please explain.
    >>
    >> --
    >> 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
     
    Jay Brigand, Apr 12, 2011
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Cranston

    OL2003 and Sending Mail via VBA

    John Cranston, May 6, 2004, in forum: Microsoft Outlook VBA Programming
    Replies:
    12
    Views:
    398
    Ken Slovak - [MVP - Outlook]
    May 11, 2004
  2. Joost

    Outlook Security Message while sending e-mail via VBA

    Joost, Aug 28, 2004, in forum: Microsoft Outlook VBA Programming
    Replies:
    3
    Views:
    467
    Sue Mosher [MVP-Outlook]
    Aug 30, 2004
  3. Catalin

    Choose the email account when sending emails via VBA

    Catalin, Jan 12, 2008, in forum: Microsoft Outlook VBA Programming
    Replies:
    4
    Views:
    580
    Ken Slovak - [MVP - Outlook]
    Jan 14, 2008
  4. Gruver

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

    Gruver, Jul 22, 2009, in forum: Microsoft Outlook VBA Programming
    Replies:
    5
    Views:
    4,922
    Mikeyb070285
    May 22, 2012
  5. sam

    Email Help: Sending Outlook email from Excel VBA

    sam, Jan 11, 2010, in forum: Microsoft Outlook VBA Programming
    Replies:
    6
    Views:
    902
Loading...

Share This Page