I’m experiencing a problem using the OLEObject with Outlook 2019. I have an application that processes emails which works fine with Office 365. I’m opening the email and accessing various properties using the OLEObject:
' Connect to Outlook
Dim objOutlook As New OLEObject("Outlook.Application")
Dim myItem As OLEObject
' Open the email message
myItem = objOutlook.Session.OpenSharedItem(txtPath.Text)
' Display a property
MsgBox myItem.Value("HTMLBody")
' Or
MsgBox myItem.HTMLBody
'Close the Email
myItem.Close(False)
If I open an email file using Outlook365, all the properties are available. However, if I use Outlook 2019, a lot of the properties throw an error. Some properties that fail are HTMLBody, SenderName, Body
Example errors I’m getting are:
OLEException,-2147467260,Unknown error: -2147467260, (failed on “HTMLBody”)
OLEException,-2147352567,Exception code 4096: The object does not support this method., (failed on “Body”)
Does anyone have any ideas or do I need to open a ticket?
Thanks in advance