3
votes

I'm doing some work with an icalndar appointment generation; this would allow a delegate to view an event's website and click on a link provided to add an appointment to their calendar.

I have a working assembly that will generate an ics formatted output (as either a physical file or a Stream) based on a known set of information (start date, end date, title etc.).

An example of the output I generate for a calendar appointment is the following:

BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
CLASS:PUBLIC
CREATED:20110210T124703Z
DESCRIPTION:Anything Else\n\nHopefully some useful information would be written here\n
DTEND:20110212T100000Z
DTSTAMP:20110210T124600Z
DTSTART:20110212T090000Z
LAST-MODIFIED:20110210T124703Z
LOCATION:Dummy Location
PRIORITY:5
SEQUENCE:0
SUMMARY;LANGUAGE=en-us:Dummy Meeting
TRANSP:OPAQUE
UID:040000008200E00074C5B7101A82E00800000000B0D1061C57C8CB01000000000000000
    010000000281117EDC1194242B64F0247C54DB401
X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">\n<HTML>\n<HEAD>\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html\;    charset=Windows-1252">\n<META NAME="Generator" CONTENT="MS Exchange Server
 version 6.5.7654.12">\n<TITLE>Dummy Meeting</TITLE>\n</HEAD>\n<BODY>\n<!-
- Converted from text/plain format -->\n\n<P><FONT SIZE=2>&lt\;h1&gt\;Anyt
hing Else&lt\;/h1&gt\;&lt\;p&gt\;Hopefully some useful information would b
e written here&lt\;/p&gt\;<BR>\n</FONT>\n</P>\n\n</BODY>\n</HTML>
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-IMPORTANCE:1
END:VEVENT
END:VCALENDAR

What I have been asked is; is it possible to change the appointment, but the next time someone requests the reminder it will detect the appointment as already existing in their calendar and update it instead of creating a new entry?

So I am trying to find if it is possible to overwrite an existing calendar appointment.

I noticed that there was a UID value, I have tried keeping this value the same, but it doesnt appear to provide a link between the calendar appointments.

Is it possible that the Save and Close action on the calendar appointment generates a new UID so there is no longer a link?

What else can I try?

2

2 Answers

2
votes

It is possible to update an appointment, but not the way you did it. Here's what's important:

  • METHOD should be REQUEST - a PUBLISH event will not update, it will be added again and again. REQUEST meeting requests behave differently, and will update the existing meeting even before the user approves it. I'd note that if the events are already of type Publish, they cannot be updated (at least to my knowledge).
  • You must use the exact same UID.
  • DTSTAMP should be bigger than the existing date stamp (this should be OK if you're creating it dynamically)
  • Include an ORGANIZER - Outlook may not allow people to accept the meeting without it (not really related, but important).

I have a partial summery of this in my blog - Sending Meeting Requests to Outlook via ASP.NET Mail Message, though it's missing sending the approval to the organizer, and time zones (which are very important, so I've heard).

See also: RFC 2446 - iTIP, search for section 1.3 ITIP Roles and Transactions

1
votes

It is possible to update PUBLISHed entries. You do not need to change your METHOD to REQUEST (and set RSVP=FALSE on every ATTENDEE).

To have a new copy replace any existing one, all you need to do is bump the SEQUENCE value. The SEQUENCE property is primarily intended to differentiate between versions of an entry where something time related changed (e.g. DTSTART).

However RFC 2445 does not preclude SEQUENCE being bumped for any arbitrary reason (e.g. fixing a typo). Doing so would invalidate any workflow responses for the entry since they would be for lower SEQUENCE values but in the PUBLISH case there is no workflow really; its all one way.

If you are not making any time related changes to the entry then you can simply change the DTSTAMP value to a newer one. The recipient will see they already have the UID and SEQUENCE value but an older DTSTAMP, so they should simply update what they have already.

Anyone who fails to update a PUBLISHed entry when its SEQUENCE or DTSTAMP have been updated does not understand the standard or failed to implement it properly.