我想制作一个 Outlook 插件来自动将附件文件制作为 ZIP 文件。现在,我必须获取 TaskItem 以使我发送给其他人的任务邮件只有 ZIP 附件文件。
我已经尝试了以下代码来获取TaskItems。但总是得到我自己发送的TaskItem。我发送给其他人的任务邮件还不是压缩文件。
希望有人可以帮助我。谢谢。
//the addin start up
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
Application.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend);
}
//before send the mail
public void Application_ItemSend(object Item, ref bool Cancel)
{
//get the task items
var myinspector = Application.ActiveInspector();
if (myinspector != null)
{
//get the TaskItem
TaskItem OutlookTaskItem = myinspector.CurrentItem as TaskItem;
/*
automatically to make attachment file to ZIP file.
*/
}
}