I am using VS 2010 & Dot Net Framework 2.0. I have created a project in Extensibility->Shared Add-ins for Outlook. I am trying to capture ReplyToAll Event it is not getting
The COM object that you expect to raise the event needs to be alive. Your code above loops through all items in the Inbox (ouch! why?) and uses the same variable on each iteration thus wiping out the previous value.
To reply to a message, it needs to be selected first, thus you only need to loop through the selected items (Explorer.Selection collection). Track the selection by hooking the Explorer.SelectionChanged event, in that event handler, loop through all items in the Explorer.Selection collaction and put them in your own List<MailItem>
list. This way the objects will be alive until you remove them frm the list.
Better than that, instead of using List<MailItem>
list, create your own wrapper that stores MailItem as a private member and hook up the ReplyAll event in that wrapper. This way when the event fires, your will know which MailItem object raised the event. The wrappers for each selected MailItem can then be stored in a List<MyMailItemWrapper>
collection.