internal static OutlookPstManager Create(string storeId, string folderId) { var session = new Redemption.RDOSession(); session.Logon(); Redemption.RDOFolder folder; if (string.IsNullOrEmpty(storeId) || string.IsNullOrEmpty(folderId)) { folder = session.PickFolder(); if (folder == null) { throw new Exception("Target folder not selected"); } Console.WriteLine($"Selected folder is {folder.EntryID} in store {folder.StoreID}"); } else { folder = session.GetFolderFromID(folderId, storeId); if (folder == null) { throw new ArgumentException($"Unknown target folder {folderId}", nameof(folderId)); } } return(new OutlookPstManager(session, folder)); }
/// <summary> /// logon using default outlook mail profile /// </summary> /// <returns>true if no error</returns> public bool logon() { bool bRet = false; try { rdo.Logon(); bRet = true; } catch (Exception ex) { helpers.addExceptionLog(ex.Message); } return(bRet); }