Load VCS and save as ICS

Hello
Need a quick help, the sample to load VCS file and save it as ICS?
Thanks :slight_smile:

@australian.dev.nerds

Please use the following code example to convert VCS to ICS file format.

AppointmentLoadOptions options = new AppointmentLoadOptions();
Appointment app = Appointment.Load(MyDir + "input.vcs", options);
app.Save(MyDir + "output.ics", AppointmentSaveFormat.Ics);
1 Like

Hello,
One issue here: input file is VCS (and maybe ICS) and need to be saved as ICS:

But I need to use the new added feature: EMAILNET-40795 > Provide APIs to set product ID

So this works:
MyAppointment.Save(“xxx”, AppointmentSaveFormat.Ics)

But not this one:
MyAppointment.Save(“xxx”, MapiCalendarIcsSaveOptions…)

Hello @australian.dev.nerds,

Isn’t ICS based on VCS? As far as I know, ICS is essentially version 2.0 of VCS. I think that all methods available for ICS will also be applicable for VCS. Thanks.

1 Like

Hello,
Yes, 100% correct, I meant using the given code, when loading VCS to save as ICS:
Appointment.Save accepts AppointmentSaveFormat.Ics but not MapiCalendarIcsSaveOptions

Hello @australian.dev.nerds,

Sorry, but I’m not quite sure why you need MapiCalendarIcsSaveOptions.
There is AppointmentIcsSaveOptions class for saving Appointment in ics format.

Dim MyAppointment = Appointment.Load("my.vcs", appLoadoOptions)
Dim icsSaveOptions = New AppointmentIcsSaveOptions() With {
        .ProductId = "Some prodId"
}
MyAppointment.Save("my.ics", icsSaveOptions)

Please correct me if you mean another use case.
Thanks.

1 Like

Hello and thanks so much for correcting me.

The sample code provided in the release notes here:

AppointmentIcsSaveOptions does not have KeepOriginalDateTimeStamp, and don’t know about SequenceId format…
Best :slight_smile:

@australian.dev.nerds,

AppointmentIcsSaveOptions does not have KeepOriginalDateTimeStamp, and don’t know about SequenceId format…

Ooh yes, you’re right. The best solution would be creating an unified save options class for both Appointment and MapiCalendar instead of two separate ones. Created the EMAILNET-40916 for this. Thank you.

1 Like

Hi,
Thanks, merging AppointmentIcsSaveOptions and MapiCalendarIcsSaveOptions would be great :slight_smile:

Hello,
Just a note that we don’t have 2 save options for calendar, but 7, seems many developers worked on the code over the years:

ICS:
Email.Calendar.AppointmentIcsSaveOptions
Email.Calendar.IcsSaveOptions
Email.Mapi.MapiCalendarIcsSaveOptions

MSG:
Email.Mapi.MapiCalendarMsgSaveOptions
Email.Calendar.AppointmentMsgSaveOptions

Generic:
Email.Mapi.MapiCalendarSaveOptions
Email.Calendar.AppointmentSaveOptions

vs 1 for load: Email.Calendar.AppointmentLoadOptions

@australian.dev.nerds,

Noted. Thank you for paying attention to this.

IcsSaveOptions - marked as obsolete and will be removed in a next release.

Aspose.Email.Calendar.AppointmentSaveOptions is an abstract class that contains general settings for saving to various formats from the Appointment class.
The AppointmentIcsSaveOptions and AppointmentMsgSaveOptions classes inherit from it and are designed to be converted and saved in Ics and Msg formats with additional options from the Appointment class.

Aspose.Email.Mapi.MapiCalendarSaveOptions is an abstract class that contains general settings for saving to various formats from the MapiCalendar class.
The MapiCalendarIcsSaveOptions and MapiCalendarMsgSaveOptions classes inherit from it and are designed to convert and save in Ics and Msg formats with additional options from the MapiCalendar class.

Descendant classes do not contain a sufficient number of settings, but allow to add them at the request of users without changing the public API.Collecting all settings in one class for saving does not make sense because formats differences required different settings that will not make sense in some cases and will confuse users.