Outlook 2016 - "Run-time error '287': Application-defined or object-defined error" while using CurrentItem.Saveas or CurrentItem.HTMLBody

Joined
Jul 25, 2019
Messages
3
Reaction score
2
Hello,
I have an Access Database running for quite a few years under "Office 2010" but now we have to change to Office 365 and I am getting this annoying error with the code below:

Dim olAppSaida As Outlook.Application
Dim olItemSaida As Outlook.MailItem

Set olAppSaida = CreateObject("Outlook.application")

Set olItemSaida = olAppSaida.ActiveInspector.CurrentItem

If Not TypeName(olItemSaida) = "Nothing" Then
olItemSaida.SaveAs "C\TEstes\" & strProcesso & ".Msg", olMSGUnicode

End If

I Have the reference to Outlook XX.X library checked, but the error ocurrs in the line:
"olItemSaida.SaveAs "C\TEstes\" & strProcesso & ".Msg", olMSGUnicode"

Can anyone help me, please?
 
Last edited:
Back
Top