我正在开发 Outlook 2013 插件。
我的场景:
从 Outlook 邮件窗口获取所选电子邮件的电子邮件数据
创建新的电子邮件项目
使用所选电子邮件中的电子邮件数据更新新电子邮件项目
发送电子邮件
如果我选择不带附件的电子邮件并进行操作,那么它工作正常。
但是,如果选定的电子邮件有附件,那么我会收到错误成员未找到。(来自 HRESULT 的异常:0x80020003 (DISP_E_MEMBERNOTFOUND))
要获取选定的电子邮件数据,我使用以下代码
MailItem mailItem = null;
Attachments mtAttachments = null;
Explorer explorer = Globals.ThisAddIn.Application.ActiveExplorer();
if (explorer != null && explorer.Selection != null && explorer.Selection.Count > 0)
{
object item = explorer.Selection[1];
if (item is MailItem)
{
mailItem = item as MailItem;
subject = mailItem.Subject;
body = mailItem.HTMLBody;
mtAttachments = mailItem.Attachments;
}
}
要发送带有附件的新电子邮件,我正在使用以下代码。
而且我正在低于 Error 。
谁能帮帮我吗。?