Hi,
I’m trying to add calendar event to PST (attached event).
And getting this exception:
Exception in thread “main” class
com.aspose.email.system.exceptions.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Not a valid Win32 FileTime.
com.aspose.email.system.DateTime.toFileTimeUtc(Unknown Source)
com.aspose.email.system.DateTime.toFileTime(Unknown Source)
com.aspose.email.MapiProperty.a(SourceFile:1145)
com.aspose.email.MapiProperty.a(SourceFile:1065)
com.aspose.email.MapiPropertyContainer.a(SourceFile:759)
com.aspose.email.MapiMessage.a(SourceFile:3652)
com.aspose.email.MapiMessage.e(SourceFile:2945)
com.aspose.email.MapiMessage.fromMailMessage(SourceFile:1541)
this is the code:
PersonalStorage pst = PersonalStorage.create("/tmp/calendar.pst", FileFormatVersion.Unicode);
FolderInfo tmpFolder = pst.createPredefinedFolder(“Calendar”, StandardIpmFolder.Appointments);
MapiConversionOptions options = new MapiConversionOptions(OutlookMessageFormat.Unicode);
Appointment app = Appointment.load(Files.newInputStream(Paths.get("/tmp/event.ical")));
final MailMessage msg = new MailMessage();
msg.addAlternateView(app.requestApointment());
final MapiMessage mapi = MapiMessage.fromMailMessage(msg, options);
final MapiCalendar tmpCal = (MapiCalendar) mapi.toMapiMessageItem();
tmpFolder.addMapiMessageItem(tmpCal);
Please advise.
Thanks.
event.ical.zip (922 Bytes)