7

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)
{
    // ...
}
2
  • Does the property Caption of the Inspector not give any clues? Apr 23, 2012 at 13:58
  • I checked, it states "Message" for both
    – default
    Apr 23, 2012 at 13:59

1 Answer 1

6

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

2
  • Wont will work if the message is a reply, only if is a new mail messagem Jun 22, 2017 at 21:29
  • Finally! Any documentation you can point us to for similar issues? I've been searching way too long for this..
    – OverMars
    May 30, 2019 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.