我正在使用 VSTO (visual studio 2010) 为 Outlook 2010 开发一个加载项。我正在处理邮件项目,想要获得一个新的电子邮件属性,并在发送新电子邮件时在某些条件下做一些工作,我可以获得一些属性,如subject
, body
, To
, CC
, BCC
, Category
。但是我无法获得一些属性,例如"From"
, Attachment (have or not)
, attachment size and name
, checked as high importance or not
, checked as sensitivity or not
, request delivery
...request read recipt
和其他一些属性...。下面是我使用的代码:
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
Application.ItemSend+=new Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend);
}
void Application_ItemSend(object Item, ref bool Cancel)
{
Outlook.Recipient recipient = null;
Outlook.Recipients recipients = null;
Outlook.MailItem mail = Item as Outlook.MailItem;
string selectedAccount= ?????
}
我怎样才能得到后者的属性?