I am simply converting a list of message files to a combined pst. Below is my code:
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();
This is a windows form application. Running above code creates a file combined.pst in the test folder. When I try to open this pst in outlook, outlook prompts that this pst is currently being used by another process. After I close my win from application, pst can be loaded. I think redemption API is locking the created PST. What am I missing? What other object do I need to dispose?
PST provider keeps a PST file referenced and loaded for 30 minutes for the performance reasons. Or until the PST provider dll itself gets unloaded (e.g. when the host process terminates). You might want to play with the registry key mentioned in http://support.microsoft.com/Default.aspx?kbid=222328