确定MailItem是在Compose还是Read模式下打开

时间:2012-04-23 13:44:43

标签: c# outlook outlook-2007

我是否可以通过某种方式确定MailItem(此处不确定术语)或ReadMail view中是否正在打开Compose view。也就是说,我是打开发给我的邮件,还是打开邮件发送给某人。

我已检查MailItemInspector个对象,但找不到任何相关内容。不幸的是我不知道如何访问特定的属性(我在某处看到了一些GetProperty()方法)所以我不知道我是否可以通过它访问它..

我希望能有一些我能做的事情:

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

1 个答案:

答案 0 :(得分:6)

当消息处于读取模式时,

_MailItem.Sent将为true,而当消息处于撰写模式时,

{{3}}将为真。