【发布时间】:2017-02-20 03:54:24
【问题描述】:
当有人阅读他们的邮件时,我整理了以下代码来编写一个事件。但我只需要在第一次阅读时才写。关于如何实现这一点的任何想法。
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
inspectors = this.Application.Inspectors;
inspectors.NewInspector += new Outlook.InspectorsEvents_NewInspectorEventHandler(Inspectors_NewInspector);
application = new Outlook.Application();
oINS = application.GetNamespace("MAPI");
}
void Inspectors_NewInspector(Microsoft.Office.Interop.Outlook.Inspector Inspector)
{
currentItem = Inspector.CurrentItem as Outlook.MailItem;
currentItem.Read += new Outlook.ItemEvents_10_ReadEventHandler(item_read);
}
void item_read()
{
WriteAudit("Item being read newly");
}
【问题讨论】:
标签: c# outlook outlook-addin