Consulting

Results 1 to 7 of 7

Thread: Review all Email Recipients before Sending

  1. #1

    Review all Email Recipients before Sending

    Hi team, I have some experience in VBA but I'm rusty and trying to recreate a macros from years ago to display all email recipients prior to sending. So, essentially, a pop-up box would appear when the send button is clicked that will list all the recipients for one last review and a confirmation to send. Any thoughts?

  2. #2
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,189
    Location
    Try this one
    Option Explicit
    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim Prompt As String
    Prompt = "Are you sure you entered all correct recipients?"
    If MsgBox(Prompt, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for recipients") = vbNo Then
    Cancel = True
    End If
    End Sub
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  3. #3
    Quote Originally Posted by rallison0902 View Post
    will list all the recipients for one last review
    As a small add-on to Aussiebear's response, for the list of recipients, use the Item object which will be a MailItem you could add a string that contains the list that is displayed with the message asking if they are all correct.

    Dim recipientList as String
    Dim rp as Outlook.Recipient
    
    recipientList = ""
    For Each rp in Item.Recipients
        recipientList = recipientList & rp.Name & vbCrLf
    Next
    
    Prompt = recipientList & "Are you sure you entered all correct recipients?"
    This code hasn't been tested and is just an example.

  4. #4
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,189
    Location
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  5. #5
    Teamwork!

  6. #6
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,189
    Location
    yes, but the Captain/Coach of the home team appears to have subbed themselves out of the game..... Strange method of asking for help and then just disappear.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  7. #7
    HA! Didn't disappear - apologies for the delay. I can't thank you enough for your help. Testing this morning and will check back in!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •