1

I am using ical4j to generate a calendar with 2 events. I have generated the following ics file:

BEGIN:VCALENDAR
PRODID:-//Events Calendar//iCal4j 1.0//EN
CALSCALE:GREGORIAN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
DTSTAMP:20210823T123718Z
DTSTART:20210810T090000
DTEND:20210810T100000
SUMMARY:Test event 1
UID:b9b49cb5-b207-4faa-9fb8-a435b455b3b1
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20210823T123718Z
DTSTART:20210809T090000
DTEND:20210809T100000
SUMMARY:Test event 2
UID:46b04290-75b1-4651-a5b3-5a0b2ace3ad5
END:VEVENT
END:VCALENDAR

When I open it in Outlook, it creates a new calendar called "Untitled" in the "Other Calendars" section, and adds the two events.

How can I make sure that the events are added to the user's default/main calendar instead?

tcelvis
  • 155
  • 2
  • 14

1 Answers1

1

It could be that Outlook treats a calendar object with multiple events (i.e. events with different UID values) differently to single event calendar objects.

Note that this is entirely up to the CUA implementation, so I can't be 100% certain, but I would suggest to try sending as separate calendar objects for each different event (not sure if you can attach multiple in one email or would need separate delivery).

You may also want to try sending them in the same attachment as follows:

BEGIN:VCALENDAR
PRODID:-//Events Calendar//iCal4j 1.0//EN
CALSCALE:GREGORIAN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
DTSTAMP:20210823T123718Z
DTSTART:20210810T090000
DTEND:20210810T100000
SUMMARY:Test event 1
UID:b9b49cb5-b207-4faa-9fb8-a435b455b3b1
END:VEVENT
END:VCALENDAR

BEGIN:VCALENDAR
PRODID:-//Events Calendar//iCal4j 1.0//EN
CALSCALE:GREGORIAN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
DTSTAMP:20210823T123718Z
DTSTART:20210809T090000
DTEND:20210809T100000
SUMMARY:Test event 2
UID:46b04290-75b1-4651-a5b3-5a0b2ace3ad5
END:VEVENT
END:VCALENDAR
fortuna
  • 701
  • 5
  • 7
  • The scenario is that I am trying to dynamically create ics files for an event website where members can download the files and add them to their calendars. I have tried with your suggestion, and Outlook still creates a "dummy" calendar with 2 events. I tried splitting them into two separate files, and this seems to work. – tcelvis Aug 23 '21 at 18:41
  • Apparantly, this use case seems to be unsupported by MicroSoft. It seems the users need to download the ics file and import it into Outlook: https://answers.microsoft.com/en-us/msoffice/forum/all/outlook-desktop-client-not-opening-multiple-events/2b4dc0e3-250c-427f-91ca-690b52b8eee6 – tcelvis Aug 23 '21 at 19:13
  • Yes, all examples I've seen where an event is generated for import do provide a single *.ics file for each event. – fortuna Aug 23 '21 at 23:53