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

Free Support Forum - aspose.com

Outlook is unable to open multiple events saved in single ICS file (C# .NET)

I have created an ICS file from the Aspose Email for Java using the following code from aspose documentation

    // ExStart: WriteMultipleEventsToICS
    IcsSaveOptions saveOptions = new IcsSaveOptions();
    saveOptions.setAction(AppointmentAction.Create);
    CalendarWriter writer = new CalendarWriter("WriteMultipleEventsToICS_out.ics", saveOptions);

    //Set the start and end date of meeting
    Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT"));


    MailAddressCollection attendees = new MailAddressCollection();
    attendees.addItem(new MailAddress("sarthak.garg@abc.com"));
    attendees.addItem(new MailAddress("jerin.joseph@abc.com"));

    try {
        for (int i = 0; i < 10; i++) {

            c.set(2019, 06, 1 + i, 22, 00, 11);
            Date startDate = c.getTime();
            c.set(2019, 06, 1 + i, 22, 30, 11);
            Date endDate = c.getTime();

            //create Appointment instance
            Appointment app = new Appointment("Room 112", //location
                    startDate, //start time
                    endDate, //end time
                    new MailAddress("kapil.gupta@abc.com"), //organizer
                    attendees //attendee
            );
            app.setDescription("Test body " + i);
            app.setSummary("Test summary:" + i);
            writer.write(app);
        }
    } finally {
        writer.dispose();
    }

Please find the generated ics file in the zip below.
WriteMultipleEventsToICS_out.zip (1.0 KB)

I am sending it as attachment to the attendees,
In the Windows Outlook Desktop Client(Office 365) , when the user clicks on the attachment, it only shows the first event.

However on the Outlook webclient, when the user clicks on add to calendar, all the events are added to the calender, without any issue.

Please let us know if there is any special handling for the outlook desktop client.

Thanks
Kapil

1 Like

@kapilgupta,

I have observed the issue shared by you and an issue with ID EMAILJAVA-34544 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

Hi Mudassir,
Can you provide us with a time it might take to fix this issue, we are dependent on this fix to be available for one of our deliverable.

Thanks
Kapil

@kapilgupta,

I have verified from our issue tracking system and like to share that issue has tentatively been marked for fixing in upcoming Aspose.Email for Java 19.6. We request for your patience and will share good news with you as soon as the issue will be fixed.

2 posts were split to a new topic: Outlook is unable to open multiple events saved in single ICS file

@kapilgupta

With METHOD:PUBLISH, you can add multiple events and upon opening the iCal with MS Outlook it will create a new calendar, separate from your main Exchange calendar. The METHOD:REQUEST creates a calendar invite, so you can only include one event and upon opening with MS Outlook. It will ask you to accept the event and add it to your main Exchange calendar. Please check the following code snippet. Hope this helps you.

IcsSaveOptions saveOptions = new IcsSaveOptions();
saveOptions.setAction(AppointmentAction.Create);
saveOptions.setMethodType(AppointmentMethodType.Publish);
CalendarWriter writer = new CalendarWriter("WriteMultipleEventsToICS_out.ics", saveOptions);