Unable to save LastModified to Calendar Item

When extracting items from a PST, we identify the type (msg, vcard, task, etc) and save it to disk in its proper format. When doing this with Calendar items, we would like to include the LastModified mapi property so we can later use it when we read the ICS. This is what Outlook does when you save a calendar item to disk.


I have not been able to find any way to do this with Aspose.Email. Can you please explain how I would go about this?

Thanks!

Hi Scott,


Thank you for posting your inquiry.

Could you please try the following sample code and share your feedback with us? It sets the last modification time property on the calendar item and can be used later on as per needs.

Code:



MapiCalendar calendar = new MapiCalendar(

“LAKE ARGYLE WA 6743”,

“Appointment”,

“This is a very important meeting :)”,

new DateTime(2012, 10, 2, 13, 0, 0),

new DateTime(2012, 10, 2, 14, 0, 0));


//Set DateTime property

MapiProperty ModificationTime = new MapiProperty(MapiPropertyTag.PR_LAST_MODIFICATION_TIME, convertDateTime(new DateTime(2013, 9, 11)));

calendar.SetProperty(ModificationTime);

calendar.Save(“11Cal.msg”, AppointmentSaveFormat.Msg);