HELP: Outlook 2003 Doesn’t Display my HTML Body

If you’ve developed a custom message store and you can’t get Outlook to display RTF or HTML content, check the length of your EntryIDs. If your RTF content is really just wrapped HTML content or you are providing PR_HTML, and for some reason Outlook 2003 won’t display your HTML content, it may be the length of your EntryIDs.

Outlook 2003 leverages IE (mshtml) to display it’s HTML content. It does this by implementing a protocol handler for the outbind:// protocol. Outbind’s format leverages the EntryID of the message when creating the URL. You can probably see where I’m going here. If your entryID is longer than the allowable limit for a URL, which for IE7 is 0x200 (512) characters, then mshtml fails the load of the HTMLDocument. When that happens, Outlook says “oh, well, RTF/HTML didn’t work, let’s just load PR_BODY and live with that.

If you’ve verified that your EntryID is sufficiently short enough (maybe only 100 or so characters) then you may want to look at the values you’re returning in the GetProps or QueryRows call.

This could change from version to version, but in general, you just return MAPI_E_NOT_FOUND for properties you don’t support, MAPI_E_NOT_ENOUGH_MEMORY that you support but don’t want to return in this GetProps call necessarily. If you return the size error for PR_BODY, PR_HTML, and PR_RTF_COMPRESSED then the RTFSync property will determine the preference on whether we use HTML or RTF. Of course, you should always be returning the value (or MAPI_E_NOT_FOUND) if asked for the property directly (as in OpenProperty or HrGetOneProp).


Comments (2)

  1. Windoze says:

    This is a lifesaving article. I’ve struggled with getting HTML message bodies to render in Outlook 2003 for around 3-4 months. It worked perfectly in OL 2007 but not in 2003.

    This article has totally made my day! Thank you Patrick Creehan.