Hi Aspose
Using the below ICS file and code, running Aspose.Email for Java 17.2, we receive the error ‘class com.aspose.email.system.exceptions.ArgumentOutOfRangeException: Specified argument was out of the range of valid values’ when creating the MapiMessage. This error is being generated by the RRULE, although the ics file can be dragged into Outlook correctly. Can you please explain what we are doing wrong?
Thanks
ICS file
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//IONET Software//NONSGML Notes 9.0.1//EN_C
METHOD:PUBLISH
BEGIN:VEVENT
CLASS:PUBLIC
DTSTART:20170605T020000Z
DTEND:20170605T030000Z
RRULE:FREQ=WEEKLY;COUNT=4
TRANSP:OPAQUE
LAST-MODIFIED:20170327T204644Z
DTSTAMP:20170327T204620Z
SEQUENCE:0
SUMMARY:Weekly meeting test
UID:84FCD93F048970D6CC2580F00071FF27
END:VEVENT
BEGIN:VEVENT
CLASS:PUBLIC
DTSTART:20170612T040000Z
DTEND:20170612T050000Z
TRANSP:OPAQUE
RECURRENCE-ID:20170612T020000Z
LAST-MODIFIED:20170327T212647Z
DTSTAMP:20170327T204620Z
SEQUENCE:1
SUMMARY:Weekly meeting test
UID:84FCD93F048970D6CC2580F00071FF27
END:VEVENT
END:VCALENDAR
Code
PersonalStorage pst = null;
AppointmentLoadOptions apptLO;
Appointment calDoc;
MailMessage calMsg;
MapiMessage calMapiMsg;
FolderInfo calFolder;
MapiCalendar mapiCal;
try {
String pathPSTFileStr = “c:\temp\testPST.pst”;
String testFile = “c:\temp\test.ics”;
pst = PersonalStorage.create(pathPSTFileStr, 0);
apptLO = new AppointmentLoadOptions();
apptLO.setApplyLocalTZ(true);
calDoc = Appointment.load(testFile, apptLO);
calMsg = new MailMessage();
calMsg.addAlternateView(calDoc.requestApointment());
calMapiMsg = MapiMessage.fromMailMessage(calMsg); //error here
calFolder = pst.createPredefinedFolder(“Calendar”, StandardIpmFolder.Appointments);
mapiCal = (MapiCalendar)calMapiMsg.toMapiMessageItem();
calFolder.addMapiMessageItem(mapiCal);
}
catch(Exception e) {
System.out.println("Import Error : " + e.toString());
}
finally {
pst.dispose();
}
Hi Peter,
Hi Kashif
Thanks for your reply. We have a valid license so I’m not sure why it isn’t being used. I’ll check this and reply here if there are still issues.
Thanks
Hi Peter,
Hi Kashif
By applying the license the initial problem has gone away, however Aspose still ignores the RECURRENCE-ID value.
For example, when dragging the ICS file manually into Outlook, we see 4 meetings, starting 5 June. The meeting 12 June is correctly changed to the specified time based on the RECURRENCE-ID value. This does not happen when importing using Aspose.Email, regardless of including timezone information or using UTC times. All meetings have the same time.
Another problem is that when opening the imported entries, the dates and times are incorrect in the information area at the top of the meeting, e.g. ‘Occurs every…’.
Thanks
Hi Peter,
Hi Kashif
Yes for sure. In the first image, the ics file has been dragged into Outlook. This correctly reads the RECURRENCE-ID value in the second VEVENT, identifies it as the second entry in the recurring (first) VEVENT, and changes the time of that meeting to 10am.
In the second screenshot (created using Aspose), this does not happen, and all times are still 9am.
Please note I changed the times slightly in the ICS file, as below.
Regards
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//IONET Software//NONSGML Notes 9.0.1//EN_C
METHOD:PUBLISH
BEGIN:VEVENT
CLASS:PUBLIC
DTSTART:20170605T090000
DTEND:20170605T100000
RRULE:FREQ=WEEKLY;COUNT=4
TRANSP:OPAQUE
LAST-MODIFIED:20170327T204644Z
DTSTAMP:20170327T204620
SEQUENCE:0
SUMMARY:Weekly meeting test
UID:84FCD93F048970D6CC2580F00071FF27
END:VEVENT
BEGIN:VEVENT
CLASS:PUBLIC
DTSTART:20170612T100000
DTEND:20170612T110000
TRANSP:OPAQUE
RECURRENCE-ID:20170612T090000
LAST-MODIFIED:20170327T212647Z
DTSTAMP:20170327T204620Z
SEQUENCE:1
SUMMARY:Weekly meeting test
UID:84FCD93F048970D6CC2580F00071FF27
END:VEVENT
END:VCALENDAR
Hi Kashif
Thanks for that. We can see that with 17.2.0 and 17.3.0 the times change correctly. However we still have a problem with exceptions to a weekly pattern. In the following ICS file, the event on 27.4 should change to 28.4, but what happens is that the event is listed twice, on both 27.4 and 28.4, so the Recurrence-ID is not correctly handled. Can you please confirm if you also see this?
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//IONET Software//NONSGML Notes Release 9.0.1//EN
BEGIN:VEVENT
CLASS:PUBLIC
TRANSP:OPAQUE
DTSTART:20170420T090000
DTEND:20170420T100000
DTSTAMP:20170403T214815Z
LAST-MODIFIED:20170406T025540Z
SEQUENCE:0
RRULE:FREQ=WEEKLY;INTERVAL=1;COUNT=5
ORGANIZER;CN=Joe User:mailto:juser@ionet.co.nz
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=Bob User:mailto
:buser@ionet.co.nz
UID:81F0D4A687D7BDB9CC2580F70077C65A
SUMMARY:Repeat weekly meeting one day different
DESCRIPTION:Some Rich Text
END:VEVENT
BEGIN:VEVENT
CLASS:PUBLIC
TRANSP:OPAQUE
RECURRENCE-ID:20170427T090000
DTSTART:20170428T090000
DTEND:20170428T100000
DTSTAMP:20170403T214818Z
LAST-MODIFIED:20170406T035540Z
SEQUENCE:1
ORGANIZER;CN=Joe User:mailto:juser@ionet.co.nz
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=Bob User:mailto
:buser@ionet.co.nz
UID:81F0D4A687D7BDB9CC2580F70077C65A
SUMMARY:Repeat weekly meeting one day different
DESCRIPTION:Some Rich Text
END:VEVENT
END:VCALENDAR
Hi Peter,
Thanks Kashif
I think there are other issues with RRULE support also - for example in the following ICS file, if I use an interval of 3 (or 5 or 6), the interval is handled correctly, but the start date is 2 days late. If I change the interval to 1, 2 or 4, everything is fine…
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//IONET Software//NONSGML Notes Release 9.0.1//EN
BEGIN:VEVENT
CLASS:PUBLIC
TRANSP:OPAQUE
DTSTART:20170508T090000
DTEND:20170508T100000
DTSTAMP:20170403T220319Z
LAST-MODIFIED:20170406T025536Z
SEQUENCE:0
RRULE:FREQ=DAILY;INTERVAL=3;COUNT=10
ORGANIZER;CN=Joe User:mailto:juser@ionet.co.nz
UID:48B94C76C5FD8B80CC2580F70079274D
SUMMARY:Repeat Test 3
DESCRIPTION:Some Text
END:VEVENT
END:VCALENDAR
Hi Peter,
I will, thanks Kashif.
Hopefully your developers can test all permutations of RRULES - finding that parameter values can change the behaviour like this is a bit worrying.
Thanks
Hi Peter,
The issues you have found earlier (filed as EMAILJAVA-34256;EMAILJAVA-34257) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan