我在某些例程中使用救赎,其中一个例程呼吁:
RDOMail rdoMail = Globals.ThisAddIn.session.GetMessageFromID(mail.EntryID, folder.StoreID, Type.Missing);
,它最终引发了这个例外,它并不总是发生:
Error in IMAPISession.OpenEntry: MAPI_E_NOT_FOUND StackTrace: at Interop.Redemption.IRDOSession.GetMessageFromID(String EntryIDMessage, Object EntryIDStore, Object Flags)
为什么会发生?有人有任何想法吗?
update
这是呼叫的上下文:
Outlook.MailItem mail = folder.Items.Add(Outlook.OlItemType.olMailItem);
Outlook.Recipient r = Globals.ThisAddIn.Application.Session.CreateRecipient(getSingleAddress(mailDetails.from));
mail.To = mailDetails.to.Replace("<", "<").Replace(">", ">");
mail.Sender = r.AddressEntry;
mail.Subject = mailDetails.subject;
mail.Save();
RDOMail rdoMail = Globals.ThisAddIn.session.GetMessageFromID(mail.EntryID, folder.StoreID, Type.Missing);
这发生了,因为MAPI无法找到带有指定条目ID的消息。
这个调用的上下文是什么?邮件变量从何而来?您是致电rdosession.logon还是将rdosession.mapiobject属性设置为namespace.mapiobjeect,trom Look?