【问题标题】:Outlook Redemption DLLs - Unable to delete emails in PSTOutlook Redemption DLL - 无法删除 PST 中的电子邮件
【发布时间】:2019-03-14 22:54:08
【问题描述】:

我正在使用以下命令从 PST 中删除电子邮件。

foreach (Redemption.RDOMail oitem in filteredItems)
{
    try
    {
        oitem.Delete();
    }
    catch (Exception ex)
    {
        PSTLog.Log("Exception in DeleteEmails: " + ex.Message);
    }
}

兑换 DLL 表明电子邮件已成功删除。如果我尝试使用 Redemption DLL 再次阅读 PST,我会收到更少的电子邮件,这是有道理的。但是,我仍然可以在 Outlook 中看到已删除的电子邮件。尝试了关闭/重新打开 Outlook 和在 Outlook 中分离/重新附加 PST 等选项,但没有帮助。

Outlook 是否有可能将结果缓存在其他地方并导致这种差异? Outlook 版本为 2016。

任何帮助将不胜感激!

【问题讨论】:

    标签: outlook outlook-redemption pst


    【解决方案1】:

    如果您正在修改集合,请不要使用foreach 循环。使用向下的“for”循环:

    foreach ( int i = filteredItems.Count; i > 0; i--)
    {
        Redemption.RDOMail oitem = filteredItems[i];
        try
        {
            oitem.Delete();
        }
        catch (Exception ex)
        {
            PSTLog.Log("Exception in DeleteEmails: " + ex.Message);
        }
        Marshal.ReleaseComObject(oitem);
    }
    

    【讨论】:

      猜你喜欢
      • 2015-07-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-22
      • 1970-01-01
      相关资源
      最近更新 更多