Determine if MailItem is Open in Build or Read Mode

Is there a way to determine if MailItem is MailItem in the ReadMail view (not sure of the terminology here) or in the Compose view . That is, I open a letter that was sent to me, or I open a letter to send to someone.

I checked MailItem and Inspector objects, but did not find anything suitable. Unfortunately, I don’t know how to access certain properties (I saw the GetProperty() method somewhere), so I don’t know if I can access it through this.

I was hoping that I could do something like:

 // where OutlookApp is my Outlok Application Outlook.Inspector inspector = OutlookApp.ActiveInspector(); Outlook.MailItem item = inspector.CurrentItem as Outlook.MailItem; if (item.IsOpenInComposeView) { // ... } 
+6
source share
1 answer

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

+5
source

Source: https://habr.com/ru/post/913937/


All Articles