【发布时间】:2017-08-28 14:19:05
【问题描述】:
我尝试在将文件附加到 mailItem 之前在 Outlook 插件中获取附件文件。
private void Inspectors_NewInspector(Outlook.Inspector Inspector)
{
if (Inspector.CurrentItem is Outlook.MailItem)
{
Outlook.MailItem mail = (Outlook.MailItem)Inspector.CurrentItem;
Inspector.AttachmentSelectionChange += Inspector_AttachmentSelectionChange;
Application.AttachmentContextMenuDisplay += Application_AttachmentContextMenuDisplay;
mail.BeforeAttachmentAdd += Mail_BeforeAttachmentAdd;
mail.AttachmentAdd += Mail_AttachmentAdd;
mail.BeforeAttachmentWriteToTempFile += Mail_BeforeAttachmentWriteToTempFile;
mail.BeforeAttachmentSave += Mail_BeforeAttachmentSave;
}}
当我在 Outlook 中创建新电子邮件时,我的代码通过此方法传递,但是当我将附件添加到我的电子邮件时,该事件永远不会触发。
有什么想法吗?
【问题讨论】:
-
哇...你的权利!非常感谢
-
很高兴它有帮助 ;)
标签: c# outlook com ms-office outlook-addin