更新重复的vCalendar事件

时间:2012-01-04 19:41:32

标签: sharepoint-2010 vcalendar

我正在开发自定义SharePoint日历,该日历使用.NET代码通过我发送给所有与会者的电子邮件呈现VCALENDAR有效负载。

到目前为止,我的实施工作正常,除了更新重复发生的事件。当我使用相同的UID发送更新的VCALENDAR时,Outlook无法识别修改的DTSTART / DTEND。看起来我错过了重复活动的特定领域。

以下是我向所有与会者发送更新现有定期活动的VCALENDAR示例:

BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft CDO for Microsoft Exchange
VERSION:2.0
BEGIN:VTIMEZONE
    TZID:tz
    X-MICROSOFT-CDO-TZID:10
    LAST-MODIFIED:20111229T172655Z
    BEGIN:STANDARD
        DTSTART:20111106T020000
        TZOFFSETTO:+0000
        TZOFFSETFROM:+0000
    END:STANDARD
    BEGIN:DAYLIGHT
        DTSTART:20120313T020000
        TZOFFSETTO:+0100
        TZOFFSETFROM:+0000
    END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
    SUMMARY:Simple Event\, Attendees:Tin Tin 
    ORGANIZER:MAILTO:tin.tin@acme.com
    ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=;X-NUM-GUESTS=0:mailto:tin.tin@acme.com
    ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=;X-NUM-GUESTS=0:mailto:tin.tin@acme.com
    LOCATION:Conference Room
    DTSTAMP:20111229T172652Z
    UID:D26B0632-8496-4E76-977F-E7A04AF4CF4D
    SEQUENCE:1
    URL;VALUE=URI:http://acme/Lists/Conf/DispForm.aspx?ID=1178
    DTSTART;TZID=tz:20111229T140000
    DTEND;TZID=tz:20111229T150000
    RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TH;WKST=SU
    END:VEVENT
END:VCALENDAR

1 个答案:

答案 0 :(得分:0)

要通过VCalendar正确更新任何现有事件,请务必在VEVENT部分中增加SEQUENCE值:

BEGIN:VEVENT
    SUMMARY:Simple Event\, Attendees:Tin Tin 
    ORGANIZER:MAILTO:tin.tin@acme.com
    ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=;X-NUM-GUESTS=0:mailto:tin.tin@acme.com
    ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=;X-NUM-GUESTS=0:mailto:tin.tin@acme.com
    LOCATION:Conference Room
    DTSTAMP:20111229T172652Z
    UID:D26B0632-8496-4E76-977F-E7A04AF4CF4D
    **SEQUENCE:2**
    URL;VALUE=URI:http://acme/Lists/Conf/DispForm.aspx?ID=1178
    DTSTART;TZID=tz:20111229T150000
    DTEND;TZID=tz:20111229T160000
    RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TH;WKST=SU
    END:VEVENT
END:VCALENDAR