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%確実ではないが、私は、Exchangeサーバーを使用するときにMAPIプロパティがないPOP/IMAP/SMTPの状況のため、だけに設定されていることを信じています。 OPは彼らが使用していることを述べていないので、これに影響する場合もありません。 –
いいえ。MAPIプロパティは、ストアに関係なく、すべてのOutlookアイテムで使用されます。 Exchange固有のプロパティがありますが、問題のプロパティは標準です。 –