4

Is it possible to create an outlook macro such that when a user presses "Reply to All", there is a prompt saying something like "Your message will be sent to the following recipients: x,y,z. Are you sure? Y/N". The key question here is if there is even a hook available to interrupt the action at all.

Note that I am not looking to disable it or to buy an add-in.

4
  • 1
    If that came default in Outlook, imagine all the savings in Inbox flooding!
    – digitxp
    Aug 24, 2011 at 19:20
  • Is it that you don't want to use an add-in, or just don't want to use one you have to pay for? Aug 24, 2011 at 20:14
  • It's the cost. I'm looking for a solution that can be deployed to around 100 machines.
    – Adam S
    Aug 25, 2011 at 16:14
  • @digitxp You can disable reply all or install the NoReplay add-on to disable the feature on selected emails
    – phuclv
    Jun 30, 2018 at 15:48

1 Answer 1

4
+50

Note: I'm working on 2007, but I think the code should transfer OK.

You can add an event handler via VBA to pick up the ReplyAll event. Something like the following:

Dim WithEvents insp As Outlook.Inspectors
Dim WithEvents mailItem As Outlook.MailItem

' This is called on Outlook startup
Private Sub Application_Startup()
    Set insp = Application.Inspectors
End Sub

' This is called when a new Inspector is created. You use it to pick up on a new mail item event
Private Sub insp_NewInspector(ByVal Inspector As Inspector)
    If Inspector.CurrentItem.Size = 0 And Inspector.CurrentItem.Class = olMail Then
       Set mailItem = Inspector.CurrentItem
    End If
End Sub

' Called when you press ReplyAll
Private Sub mailItem_ReplyAll(ByVal Response As Object, Cancel As Boolean)
    Dim msg As String
    Dim result As Integer
    msg = "Do you really want to reply to all?"
    result = MsgBox(msg, vbYesNo, "Reply All Check")
    If result = vbNo Then
        Cancel = True
    End If
End Sub
1
  • 1
    There is a note in StackOverflow that someone found a problem with the Inspector.CurrentItem.Size = 0 test and had to remove it. I don't know whether that is a problem in OL2007 or later. stackoverflow.com/questions/33278814/…
    – vknowles
    Dec 14, 2017 at 20:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .