Add float property to MapiMessage

Hi, i need to add float (PT_FLOAT, PtypFloating32) property to MapiMessage via Aspose.Email API.

But Aspose.Email.Outlook.MapiPropertyType enum has no options for floating type, and if i manually adjust property tag to represent float, i get an error “Non supported data type is specified in property tag.”.

So, is there any way to set float property via Aspose.Email?

Hi,

Thank you for contacting Aspose support team.

Aspose.Email provides option to add PT_DOUBLE type property however currently no option is available to add PT_FLOAT type property. I have logged it as enhancement ticket under Id:EMAILNET-38671 for further investigation by the product team. You will be automatically notified once any update is received in this regard.

Following sample code is given just for your reference to demonstrate the usage of PT_DOUBLE.

MapiMessage message2 = new MapiMessage();
long mapiPropertyTag2 = message2.NamedPropertyMapping.GetNextAvailablePropertyId(MapiPropertyType.PT_DOUBLE);
Guid mapiPropertyGuid2 = new Guid("6ed8da90-450b-101b-98da-00aa003f1305");//Any random Guid
MapiProperty mapiProperty2 = new MapiProperty(mapiPropertyTag2, BitConverter.GetBytes(123.456));
message2.NamedPropertyMapping.AddNamedPropertyMapping(mapiProperty2, 12, mapiPropertyGuid2);
message2.SetProperty(mapiProperty2);

foreach (MapiNamedProperty prop in message2.NamedProperties.Values)
{
    if (prop.Guid.ToString() == "6ed8da90-450b-101b-98da-00aa003f1305")
    {
        double val = prop.GetDouble();
        Console.WriteLine(val);

    }
}

Thanks for quick response!

Will wait for the ticket to be resolved

Hi,


Sure. You’ll be automatically notified over this thread once the ticket is resolved and a fix version is available for download.

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


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