Not able to query MAPI property PR_BODY_HTML_W for mails with HTML format stored in Exchange mailbox

%3CLINGO-SUB%20id%3D%22lingo-sub-2416642%22%20slang%3D%22en-US%22%3ENot%20able%20to%20query%20MAPI%20property%20PR_BODY_HTML_W%20for%20mails%20with%20HTML%20format%20stored%20in%20Exchange%20mailbox%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2416642%22%20slang%3D%22en-US%22%3E%3CP%3E%3CBR%20%2F%3EWe%20are%20not%20able%20to%20query%20MAPI%20property%20PR_BODY_HTML_W%20for%20mails%20with%20HTML%20format%20stored%20in%20Exchange%202016%20and%20Exchange%202019%20Server%20mailboxes.%3C%2FP%3E%3CP%3EOn%20making%20below%20MAPI%20call%20from%20for%20PR_BODY_HTML_W%20from%20our%20application%20code%2C%20we%20receive%20an%20error%20MAPI_E_NOT_FOUND.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EHRESULT%20hRes%20%3D%20HrGetOneProp(getMAPIPtr()%2C%20*pulPropTag%2C%20ppSPropVal)%3B%3CBR%20%2F%3EWhere%2C%3C%2FP%3E%3CP%3EgetMAPIPtr()%20returns%20a%20LPMAILUSER%3CBR%20%2F%3E*pulPropTag%20is%20of%20type%20ULONG%20-%20contains%20property%20tag%20vaue%200x1013001f%20of%20PT_UNICODE%20type%3CBR%20%2F%3EppSPropVal%20is%20of%20type%20LPSPropValue*%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E-%20On%20checking%20the%20mail%20properties%20with%20MFCMAPI%20tool%20we%20see%20the%20alias%20property%20PR_HTML%20and%20not%20PR_BODY_HTML_W.%20However%20there%20too%20we%20see%20MAPI_E_NOT_FOUND.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E-%20We%20have%20tried%20setting%20the%20'Cached%20Mode'%20to%20ON%20in%20Outlook%20client%20as%20mentioned%20in%20below%20old%20forum(%20%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2FForums%2Fie%2Fen-US%2F00086c4a-2cd9-4052-8282-ea8a777f7eff%2Fevent-id-4999-when-attempting-to-export-messages-via-mfcmapi-tool-or-copying-from-inbox%3Fforum%3Dexchangesvradmin%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsocial.technet.microsoft.com%2FForums%2Fie%2Fen-US%2F00086c4a-2cd9-4052-8282-ea8a777f7eff%2Fevent-id-4999-when-attempting-to-export-messages-via-mfcmapi-tool-or-copying-from-inbox%3Fforum%3Dexchangesvradmin%3C%2FA%3E%20).%20But%20this%20did%20not%20help.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E-%20We%20also%20confirmed%20from%20code%20that%20PR_STORE_SUPPORT_MASK%20has%20STORE_HTML_OK%20flag%2C%20which%20means%20message%20store%20that%20supports%20HTML%20as%20per%20documentation%20link%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice%2Fclient-developer%2Foutlook%2Fmapi%2Fpidtagbodyhtml-canonical-property%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice%2Fclient-developer%2Foutlook%2Fmapi%2Fpidtagbodyhtml-canonical-property%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20anything%20we%20are%20missing%20here%3F%20Is%20there%20any%20setting%20on%20Exchange%20server%20side%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2416642%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E2016%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor


We are not able to query MAPI property PR_BODY_HTML_W for mails with HTML format stored in Exchange 2016 and Exchange 2019 Server mailboxes.

On making below MAPI call from for PR_BODY_HTML_W from our application code, we receive an error MAPI_E_NOT_FOUND.


HRESULT hRes = HrGetOneProp(getMAPIPtr(), *pulPropTag, ppSPropVal);
Where,

getMAPIPtr() returns a LPMAILUSER
*pulPropTag is of type ULONG - contains property tag vaue 0x1013001f of PT_UNICODE type
ppSPropVal is of type LPSPropValue*

 

- On checking the mail properties with MFCMAPI tool we see the alias property PR_HTML and not PR_BODY_HTML_W. However there too we see MAPI_E_NOT_FOUND.

 

- We have tried setting the 'Cached Mode' to ON in Outlook client as mentioned in below old forum( https://social.technet.microsoft.com/Forums/ie/en-US/00086c4a-2cd9-4052-8282-ea8a777f7eff/event-id-4... ). But this did not help.


- We also confirmed from code that PR_STORE_SUPPORT_MASK has STORE_HTML_OK flag, which means message store that supports HTML as per documentation link: https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/pidtagbodyhtml-canonical-prope...

 

Is there anything we are missing here? Is there any setting on Exchange server side?

0 Replies