2

I am having trouble capturing the reply-to-all, reply, and forward events in Outlook 2013 (using VSTO for 2010).

Currently, I am having no problems with Inspector class, since those open a new window.

But when I click Reply or Reply-To-All in Outlook only and it shows in the same windows as outlook (not in a pop-out window), my Inspector event handler does not fire. It only fires when there is a new window pop-outed.

Is there any way to handle this, so that I can interject some code in between?

Thank you!

Water
  • 1,114
  • 1
  • 15
  • 31

1 Answers1

1

You can create an Explorer wrapper, which will wrap the main Outlook window, and put code in the SelectionChange event to create MailItem wrappers with the Forward and Reply events set up to use your code. Be sure to keep your MailItem wrapper around between selection changes so you can ensure it's disposed after the selection changes again, otherwise you'll leak wrappers and MailItems. Alternatively, put your code on the ribbon's events, which is explained here (for Office 2007, but this hasn't changed). This approach won't handle keyboard shortcuts (ctrl-f, ctrl-r and ctrl-shift-r), though.

Chris
  • 5,584
  • 9
  • 40
  • 58
The Dark Canuck
  • 267
  • 2
  • 11