BodyContentType.Html Only seems to work from Email messages

We are having some issues when attempting to save certain Exchange Item types with HTML Body Content. We are attempting to create Exchange items in the following manner:

First, we are creating an MAPI Item and setting the item’s the body and body type appropriately.

var body = GetValue<MessageBody>(item, ItemSchema.Body);

if (body != null && body.Text != null)
{
    mapiItem.SetBodyContent(body.Text, body.BodyType == BodyType.HTML ? BodyContentType.Html : BodyContentType.PlainText);
}

We are then attempting to save the item to a file.

public void SaveToMsgFile(MapiMessageItemBase item, string msgFile)
{
    if (item is MapiMessage)
    {
        (item as MapiMessage).Save(msgFile);
        return;
    }

    if (item is MapiContact)
    {
        (item as MapiContact).Save(msgFile, ContactSaveFormat.Msg);
        return;
    }

    if (item is MapiCalendar)
    {
        (item as MapiCalendar).Save(msgFile, AppointmentSaveFormat.Msg);
        return;
    }

    if (item is MapiTask)
    {
        (item as MapiTask).Save(msgFile, TaskSaveFormat.Msg);
        return;
    }
}

This works fine so long as the MAPI item is an Email Message; The body type is preserved correctly. However, when attempting to use any other item type (Task, Calendar, Contact, Meeting, etc) the body appears to always revert to Plain Text.

Is there a way to save all items with the correct body type?

Hi,


Thank you for posting your inquiry.

This seems to be an issue with the API as the behavior is same if we load and re-save existing Mapi items that have formatted contents in the body. We have logged this issue as EMAILNET-34952 in our bug tracking system so that our product team can further investigate it. We shall notify you here once there is some information about this problem.

The issues you have found earlier (filed as EMAILNET-34952) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.