我使用Visual Studio 2010創建Outlook 2007 Addin。現在我想知道電子郵件是新發送,回覆還是轉發。有沒有這方面的任何財產?如何確定電子郵件是新發送,回覆還是轉發?
using Outlook = Microsoft.Office.Interop.Outlook;
namespace _Outlook2k7_Add_In
{
public partial class ThisAddIn
{
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
void Application_ItemSend(object Item, ref bool Cancel)
{
Outlook.MailItem mail = Item as Outlook.MailItem;
if (mail == null)
return;
// Magic?
}
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
this.Application.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend);
}
#endregion
}
}
我不是100%肯定,但我相信,MAPI屬性僅使用Exchange服務器的時候,不是POP/IMAP/SMTP設置的情況。 OP沒有說明他們正在使用哪個,所以這可能會影響它們,也可能不會影響它們。 – 2011-01-12 19:06:58