Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
520 views
in Technique[技术] by (71.8m points)

asp.net - How to create a .ICS file with multiple VEVENTs to be imported into an existing Outlook Calendar

I have a need to allow for a user to download an event that has multiple meeting dates. To do this I have created a memorystream to be downloaded which produces a .ics file. For example:

BEGIN:VCALENDAR
PRODID:-//Company//Product//EN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
SUMMARY:Subject of Event
LOCATION:Location of Event
UID:[email protected]
DESCRIPTION:Some description
DTEND:20081101T200000Z
DTSTART:20081101T200000Z
PRIORITY:3
END:VEVENT
BEGIN:VEVENT
  ...
END:VEVENT
END:VCALENDAR

If I only include one VEVENT in this file it will save it to my existing Outlook calendar. However, when I have multiple VEVENTs it wants to open it as a new calendar and files it under "Other Calendars".

Is there a way (without using File - Import from within Outlook) to specify that the calendar should be imported automatically into the existing calendar when opened?

UPDATE: To clarify, each VEVENT is related to a single "Appointment". However there may or may not be a recurring pattern.

-Mike

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I don't think this will work. Outlook is limited in importing those "open" specs. I had a similar problem trying to import a vCard file with multiple contacts. I ended up splitting the file and writing a script in Outlook to import all the files in a directory.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...