Set appointment/task RTF/HTML body to display correctly in Outlook web and desktop RRS feed

  • Question

  • Hi,

    I'm using EWS API 2.0. I'm trying to set an EWS appointment/task body with formatting. I have HTML or RTF that contains fully formatted text with embedded images. I tried 2 methods:

    1. Setting appointment/task Body = new MessageBody(BodyType.HTML, htmlText). The images do not come over when I view this item in Outlook.

    2. I tried setting the RTF of the appointment/task. The item looks good in Outlook web, but not desktop. Here's my code:


    I'm using DevEx RichEdit control to obtain the RTF text - 

    byte[] rtfValue;
                using (RichEditControl richEditControl = new RichEditControl())
                    richEditControl.HtmlText = htmlText;

            ExtendedPropertyDefinition rtfPropertyDefinition = new ExtendedPropertyDefinition(0x1009, MapiPropertyType.Binary);
            _exchangeAppointment.SetExtendedProperty(rtfPropertyDefinition, rtfValue);

    How do I convert to RTF in the correct compressed format for EWS? (is that the issue here?)

    And How can I correctly set the format?


    • Edited by Pearly S Friday, April 15, 2016 1:32 PM
    Friday, April 15, 2016 1:26 PM

All replies

  • Just use 

    RtfToRtfCompressed   in Microsoft.Exchange.Data.TextConverters.


    Gregor Stefka


    Businessprocessautomation with the EWS SQL Interface SQLExchangeSync

    Thursday, April 21, 2016 8:46 AM
  • Hi - 

    I'm trying to get something like this to work for me. Interesting post. I'm having an issue getting things to display correctly. I looked up this method, but this dll looks like it needs to run on the same server as exchange. I'm not sure what that means.

    Any other ideas? Or is it simple to get this dll to work correctly anywhere?


    Tom Langin

    Sunday, May 15, 2016 2:49 PM