Building custom solutions that extend, automate, and integrate Microsoft 365 apps.
Outlook 2019 Addin savechanges fail with cache mode
Mauricio Poggio Veiro
301
Reputation points
Hi,
I have an OLK addin which save mapi properties in mail items, without cache mode it's work fine, but if cache mode is enabled it hang with this error:
"MAPI_E_NO_ACCESS"
Sample code (I'm using Redemption):
Public Shared Sub SetCampoMAPIcon_RED2(xItem As Outlook.MailItem, xsCampo As String, xsValor As String, ByRef rMail As Redemption.RDOMail, xbSave As Boolean)
Try
Dim KEEP_OPEN_READWRITE = 2, PR_MY_PROP As Object
Dim FORCE_SAVE = 4
If rMail Is Nothing Then rMail = mRDOSession.GetRDOObjectFromOutlookObject(xItem)
PR_MY_PROP = rMail.GetIDsFromNames("{00020329-0000-0000-C000-000000000046}", xsCampo) Or &H101E 'PT_UNICODE
Dim PropValue(0) As String
PropValue(0) = xsValor
**rMail.Fields(PR_MY_PROP) = PropValue** 'FAIL HERE
If xbSave Then **rMail.SaveAs("", FORCE_SAVE)** 'OR FAIL HERE
Catch ex As System.Exception
GeneroTrace("SetCampoMAPIconRedemption::", TraceLevel.Error, ex.Message & vbCrLf & ex.StackTrace & vbCrLf & xsCampo & " - " & xsValor)
End Try
End Sub
any help will be appreciated, thanks!
Mauricio.
Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Development | Other
Outlook | Windows | Classic Outlook for Windows | For business
Outlook | Windows | Classic Outlook for Windows | For business
Using classic Outlook for Windows in business environments
Sign in to answer