Outlook ReportItem.Body returning messed up encoding for some users

前端 未结 4 1589
梦如初夏
梦如初夏 2021-01-18 12:16

We have a weird issue with Outlook lately that is impacting some users.

If certain users automate the Outlook Client to view bounce backs/ReportItems in a shared inb

4条回答
  •  轮回少年
    2021-01-18 12:53

    Yes, there is a problem with ReportItem.Body property in the Outlook Object Model (present in Outlook 2013 and 2016) - you can see it in OutlookSpy: select an NDR message, click Item button, select the Body property - it will be garbled. Worse than that, once the report item is touched with OOM, Outlook will display the same junk in the preview pane.

    The report text is stored in various MAPI recipient properties (click IMessage button in OutlookSpy and go to the GetRecipientTable tab). The problem is the ReportItem object does not expose the Recipients collection. The workaround is to either use Extended MAPI (C++ or Delphi) or Redemption (any language) - its ReportItem.ReportText property does not have this problem:

    set oItem = Application.ActiveExplorer.Selection(1)
    set oSession = CreateObject("Redemption.RDOSession")
    oSession.MAPIOBJECT = Application.Session.MAPIOBJECT
    set rItem = oSession.GetRDOObjectFromOutlookObject(oItem)
    MsgBox rItem.ReportText
    

提交回复
热议问题