Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine if MailItem is open in Compose or Read mode

Is there some way that I can determine if a MailItem is being opened in a ReadMail view (not sure about the terminology here) or in a Compose view. That is, am I opening a mail that has been sent to me, or am I opening a mail to send to someone.

I've checked the MailItem and the Inspector objects but can't find anything of relevance. Unfortunately I don't know how to access specific Properties (I've seen some GetProperty() method somewhere) so I don't know if I could access it via that..

I was hoping that there would be something I could do like:

// where OutlookApp is my Outlok Application
Outlook.Inspector inspector = OutlookApp.ActiveInspector();
Outlook.MailItem item = inspector.CurrentItem as Outlook.MailItem;
if (item.IsOpenInComposeView)
{
    // ...
}
like image 232
default Avatar asked Apr 23 '12 13:04

default


1 Answers

_MailItem.Sent will be true when the message is in Read mode, and false when the message is in Compose mode.

like image 57
SliverNinja - MSFT Avatar answered Nov 25 '22 23:11

SliverNinja - MSFT