Outlook ReportItem.Body returning messed up encoding for some users

前端 未结 4 1602
梦如初夏
梦如初夏 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 13:06

    I came across this issue and I've written a function that solves the issue for me. I thought I'd share it here in case it's of use to anyone else.

    Private Sub Example()
        Dim Item As Object
        
        Set Item = Application.ActiveExplorer.Selection(1)
        
        Debug.Print ItemBody(Item)
    End Sub
    
    Public Function ItemBody(Item As Variant) As String
    On Error Resume Next
        If TypeName(Item) = "ReportItem" Then
            With Item.GetInspector
                ItemBody = .WordEditor.Content
                .Close 1
            End With
        Else
            ItemBody = Item.Body
        End If
    End Function
    

提交回复
热议问题