[英]Getting RDOMail for MailItem opened from .msg file
Is there a way of creating an RDOMail
instance for a MailItem
corresponding to an Outlook message opened from a .msg
file? 有没有一种方法可以为与从
.msg
文件打开的Outlook消息相对应的MailItem
创建RDOMail
实例?
My usual approach is to get the CurrentItem
from the Inspector
, cast it to MailItem
, retrieve its EntryID
and StoreID
values, and finally load it from an RDOSession
through the GetMessageFromID
method. 我通常的方法是从
Inspector
获取CurrentItem
,将其RDOSession
为MailItem
,检索其EntryID
和StoreID
值,最后通过GetMessageFromID
方法从RDOSession
加载它。
However, in the case of messages opened from a .msg
, the EntryID
property returns null
. 但是,对于从
.msg
打开的消息, EntryID
属性返回null
。 Is there another way around this? 还有其他解决方法吗? I assume I could use the
GetMessageFromMsgFile
method instead, but how do I retrieve the full path of the message from the MailItem
? 我假设可以改用
GetMessageFromMsgFile
方法,但是如何从MailItem
检索消息的完整路径?
PS The solution should ideally work with the Outlook 2003 object model. PS理想情况下,该解决方案应与Outlook 2003对象模型一起使用。
You could do two approaches here... 您可以在此处执行两种方法...
MailItem
to disk using _MailItem.SaveAs()
. _MailItem.SaveAs()
将MailItem
保存到磁盘。 Then use GetMessageFromMsgFile
. GetMessageFromMsgFile
。 MailItem
to a Folder
(store) to persist it, giving it an EntryID
and StoreID
. MailItem
保存到Folder
(存储)以保留它,并为其提供EntryID
和StoreID
。 Use MailItem.Save()
and MailItem.Move(tempFolder)
to persist the MSG to a folder. MailItem.Save()
和MailItem.Move(tempFolder)
将MSG持久保存到文件夹中。 I typically use a hidden folder for this storage swap .
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.