Willy
Willy

Reputation: 10652

VSTO Outlook: How to know if the window being opened is the compose window

I have an scenario in which I need to know if the window being opening is the compose window (that opened when you click on New mail). How can I do it?

Upvotes: 1

Views: 98

Answers (2)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66258

Check the value of the Inspector.CurrentItem.Sent property. Make sure Inspector.CurrentItem is actually a MailItem object first.

Upvotes: 2

wopr_xl
wopr_xl

Reputation: 307

One way you can do it is by using a FormRegion, which has a FormRegionMode property. That property holds a OlFormRegionMode enumeration value that is set by Outlook based on whether the window is in reading, compose or preview (in-line reading pane) mode.

Upvotes: 1

Related Questions