0

I'm working on a subroutine of an add-in for Outlook (based on VB.net coded in Visual Studio). The goal of the sub is to deliver a pop-up warning message box if the user clicks reply-all to an email they were Bcc'd on.

I'm struggling with how to implement this. There are two main issues I can't bust: (1) having the sub routine trigger on the reply-all event and (2) getting the sub to test the received message for the user being on bcc vs. the draft created by the reply all event.

Any suggestions on code or other threads that would be helpful are greatly appreciated!

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45

1 Answers1

1

Use the MailItem.ReplyAll event which is fired when the user selects the ReplyAll action for an item, or when the ReplyAll method is called for the item. The following sample code (VBA) shows how you could use the event handler:

Private Sub myItem_ReplyAll(ByVal Response As Object, Cancel As Boolean)  
 Dim mymsg As String 
 Dim myResult As Integer 
 mymsg = "Do you really want to reply to all original recipients?" 
 myResult = MsgBox(mymsg, vbYesNo, "Flame Protector") 
 If myResult = vbNo Then 
   Cancel = True 
 End If 
End Sub

To handle item-level events you may consider creating an inspector wrapper, see Implement a wrapper for inspectors and track item-level events in each inspector for more information.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45