private static void DeleteMessageImpl(string storeId, string entryId, bool DeletedItems) { Guard.EmptyStringArgument(storeId, "storeId"); Guard.EmptyStringArgument(entryId, "entryId"); IEMsgStore msgStore = OutlookSession.OpenMsgStore(storeId); if (msgStore != null) { try { msgStore.DeleteMessage(entryId, DeletedItems); } catch (System.ArgumentException exception) { //there is bug in parameteres for IFolder.DeleteMessages. Try to find it _tracer.Trace("There is problem with parameter while deleting message. EntryId = " + entryId); _tracer.Trace("StoreId = " + storeId); _tracer.TraceException(exception); Core.ReportException(exception, ExceptionReportFlags.AttachLog); } catch (COMException exception) { _tracer.TraceException(exception); StandartJobs.MessageBox("Cannot complete deleting mail. Reason: " + exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private static void DeleteFolderImpl(PairIDs folderIDs, bool DeletedItems) { IEMsgStore msgStore = OutlookSession.OpenMsgStore(folderIDs.StoreId); if (msgStore != null) { msgStore.DeleteFolder(folderIDs.EntryId, DeletedItems); } }
public override bool DisplayMessage(string EntryID, string StoreID) { try { IEMsgStore msgStore = OutlookSession.OpenMsgStore(StoreID); if (msgStore != null) { return(msgStore.DisplayMessage(EntryID, OutlookSession.GetDefaultMsgStore())); } } catch (Exception exception) { ReportProblem(exception); } return(false); }
public override bool ReplyMessage(IResource mail, string EntryID, string StoreID) { try { OutlookSession.EMAPISession.SetQuoter(new ReplyQuoter(mail)); IEMsgStore msgStore = OutlookSession.OpenMsgStore(StoreID); if (msgStore != null) { return(msgStore.ReplyMessage(EntryID, OutlookSession.GetDefaultMsgStore())); } return(true); } catch (Exception exception) { ReportProblem(exception); } return(false); }