Quantcast
Channel: Aspose.Email Product Family
Viewing all articles
Browse latest Browse all 1367

RRULE Problems

$
0
0
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();        
}

Viewing all articles
Browse latest Browse all 1367