Outlook Add-In: event when email is moved through inspector

1.1k views Asked by At

I need to change the category of a email when the inspector-window is closing - what I am doing with the Close event.

My problem is, if the user clicks "move to folder" in the inspector, the mail is moved, after this the close event is fired, but at this point I coannot change the mail any more, because it was changed trough the mail-move (eg: EntryID gets changed).

Any ideas? An "before-Item-moved" event on the mail would be great - or a way to reload the changed mail.

2

There are 2 answers

0
Eric Legault On

Unfortunately there's no easy way to get folder that the email was moved to. Which means you'll have to use Redemption which has events for the RDOStore object that can detect changes to any folder. But you'd also have to monitor EVERY store, because the user can obviously move it anywhere. And because the EntryID has changed, you'd need to use PR_SEARCH_KEY as the unique identifier in order to even find the email and then apply the category to it. Not fun!

Another option may be to repurpose the Move To Ribbon button to intercept the move operation, but then you'd have to provide your own folder picker! Ugly!

3
public wireless On