【发布时间】:2018-03-27 14:19:00
【问题描述】:
我只是将消息文件列表转换为组合的 pst。以下是我的代码:
RDOSession pstSession = new RDOSession();
RDOPstStore store = null;
var pstPath = "D:\\test\\combined.pst";
store = pstSession.LogonPstStore(pstPath, 1, "combinedPST");
RDOMail rdo_Mail =
pstSession.GetMessageFromMsgFile(dr["FullPathOfMessageFile"].ToString());
rdo_Mail.CopyTo(store.IPMRootFolder);
rdo_Mail.Save();
store.Save();
pstSession.Logoff();
这是一个窗体应用程序。运行上面的代码会在 test 文件夹中创建一个文件 combined.pst。当我尝试在outlook中打开这个pst时,outlook提示这个pst当前正被另一个进程使用。从应用程序关闭我的胜利后,可以加载 pst。 我认为兑换 API 正在锁定创建的 PST。我错过了什么?我还需要处理哪些其他对象?
【问题讨论】:
-
尝试设置 pstSession 并将对象存储为 null
-
试过但没用。创建一个单独的进程来创建 pst 可能会完成这项工作。
标签: c# outlook-redemption