We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Extract appointment from personalStorage

Hi

How do I extract Appointment class from PST file ?

I’ve tried from MapiCalendar :
MapiCalendar mapiAppointment = (MapiCalendar)personalStorage.ExtractMessage(messageInfo).ToMapiMessageItem();

tried to extract directly :
Appointment cal = messageInfo. personalStorage.ExtractMessage(messageInfo);

and loading through AlternateViews :
Appointment cal = Appointment.Load(message.AlternateViews.Where(t => t.ContentType.MediaType == “text/calendar”).First().ContentStream);

Also tried through MemoryStream :
MemoryStream ms = new MemoryStream();
mapiAppointment.Save(ms);
Appointment cal = Appointment.Load(ms);

nothing worked.
please help ?

Hi Daniel,


Thank you for using Aspose.Email.

Please have a look at the following code sample for your kind reference. I was able to retrieve and save all the appointments from the Calendar folder of a PST at my end without any problem. Please try it at your end and let us know your feedback.

Sample Code:

// Load the Outlook PST file<o:p></o:p>

PersonalStorage pst = PersonalStorage.FromFile(@"TestPst.pst");

// Get the Calendar folder

FolderInfo folderInfo = pst.RootFolder.GetSubFolder("Calendar");

// Loop through all the calendar items in this folder

MessageInfoCollection messageInfoCollection = folderInfo.GetContents();

foreach (MessageInfo messageInfo in messageInfoCollection)

{

// Get the calendar information

MapiCalendar calendar = (MapiCalendar)pst.ExtractMessage(messageInfo).ToMapiMessageItem();

// Display some contents on screen

Console.WriteLine("Name: " + calendar.Subject);

// Save to disk in ICS format

calendar.Save("temp\\" + calendar.Subject + ".ics", AppointmentSaveFormat.Ics);

}

Hi

Thanks for your reply
I was trying to use this method, however I’m missing some properties that exist in th appointment class and does not exist in the MapiCalendar class, such as OptionalAtendees and Organizer.
Is there a way to extract the calendar item as Appointment class ?

Hi Daniel,


The MapiCalendar object can be saved in ICS format to file or stream as its Save method shows. However, I see an exception raises in this case. I am further investigating this issue at my end and will update you soon about my findings here.

thank you for your help.


Daniel.

Hi Daniel,


After a thorough investigation of issues related to extracting appointments from a PST, I could observe the following issues and have logged them accordingly in our issue tracking system.

  • Extracting and saving appointment to stream from PST raises exception - logged as NETWORKNET-33808
  • Appointment class not recognizing optional attendees - logged as NETWORKNET-33809
  • Organizer and optional attendees missing during appointment extraction from PST - NETWORKNET-33811
Development team will look into these and once we have the fix version available for these issues, we’ll update you here and appreciate your patience in this regard.


thank you.


I’ll wait for it.

Daniel.

The issues you have found earlier (filed as NETWORKNET-33808;NETWORKNET-33809;NETWORKNET-33811) have been fixed in this update.


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