开发者

I'm having a problem when I try to use the RRULE property

开发者 https://www.devze.com 2023-03-13 12:40 出处:网络
The following code works perfectly fine for an appointment that has no re-occurance.By works fine, I mean when I send an email using this code, it shows up on the outlook calendar just fine, in the ri

The following code works perfectly fine for an appointment that has no re-occurance. By works fine, I mean when I send an email using this code, it shows up on the outlook calendar just fine, in the right time slot, on the right date. The server is in the Central Time Zone, and end users are in various time zones.

        Const VCAL_FILE =
            "BEGIN:VCALENDAR" & vbCrLf &
            "METHOD:PUBLISH" & vbCrLf &
            "PRODID:Microsoft CDO for Microsoft Exchange" & vbCrLf &
            "VERSION:2.0" & vbCrLf &
            "BEGIN:VTIMEZONE" & vbCrLf &
            "TZID:(GMT-06.00) Central Time (US & Canada)" & vbCrLf &
            "X-MICROSOFT-CDO-TZID:11" & vbCrLf &
            "BEGIN:STANDARD" & vbCrLf &
            "DTSTART:16010101T020000" & vbCrLf &
            "TZOFFSETFROM:-0500" & vbCrLf &
            "TZOFFSETTO:-0600" & vbCrLf &
            "RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=11;BYDAY=1SU" & vbCrLf &
            "END:STANDARD" & vbCrLf &
            "BEGIN:DAYLIGHT" & vbCrLf &
            "DTSTART:1开发者_Python百科6010101T020000" & vbCrLf &
            "TZOFFSETFROM:-0600" & vbCrLf &
            "TZOFFSETTO:-0500" & vbCrLf &
            "RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=2SU" & vbCrLf &
            "END:DAYLIGHT" & vbCrLf &
            "END:VTIMEZONE" & vbCrLf &
            "BEGIN:VEVENT" & vbCrLf &
            "DTSTAMP:{8}" & vbCrLf &
            "DTSTART:{0}" & vbCrLf &
            "DTEND:{1}" & vbCrLf &
            "DESCRIPTION:{6}\N" & vbCrLf &
            "SUMMARY:{7}" & vbCrLf &
            "UID:{5}" & vbCrLf &
            "ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=FALSE;CN=""{9}"":MAILTO:{9}" & vbCrLf &
            "ACTION;RSVP=FALSE;CN=""{4}"":MAILTO:{4}" & vbCrLf &
            "LOCATION:{2}" & vbCrLf &
            "SEQUENCE:1" & vbCrLf &
            "PRIORITY:5" & vbCrLf &
            "CLASS:" & vbCrLf &
            "CREATED:{8}" & vbCrLf &
            "LAST-MODIFIED:{8}" & vbCrLf &
            "STATUS:CONFIRMED" & vbCrLf &
            "TRANSP:OPAQUE" & vbCrLf &
            "X-MICROSOFT-CDO-BUSYSTATUS:FREE" & vbCrLf &
            "X-MICROSOFT-CDO-INSTTYPE:0" & vbCrLf &
            "X-MICROSOFT-CDO-INTENDEDSTATUS:FREE" & vbCrLf &
            "X-MICROSOFT-CDO-ALLDAYEVENT:FALSE" & vbCrLf &
            "X-MICROSOFT-CDO-IMPORTANCE:1" & vbCrLf &
            "X-MICROSOFT-CDO-OWNERAPPTID:-1" & vbCrLf &
            "X-MICROSOFT-CDO-ATTENDEE-CRITICAL-CHANGE:{8}" & vbCrLf &
            "X-MICROSOFT-CDO-OWNER-CRITICAL-CHANGE:{8}" & vbCrLf &
            "BEGIN:VALARM" & vbCrLf &
            "ACTION:DISPLAY" & vbCrLf &
            "DESCRIPTION:REMINDER" & vbCrLf &
            "TRIGGER;RELATED=START:-PT00H15M00S" & vbCrLf &
            "END:VALARM" & vbCrLf &
            "END:VEVENT" & vbCrLf &
            "END:VCALENDAR" & vbCrLf

However, when I add the following line

            "RRULE:{10}" & vbCrLf &

to the VEVENT section, the TZOFFSETFROM and TZOFFSETTO seem to be ignored. In other words, when the event is added to my outlook calendar, the time is off.

So, my question is when the RRULE property is used, why do my calendar events not show up in the right timeslot when imported into Outlook, but when the RRULE property is not used, the time is perfect?

Any thoughts or ideas are greatly appreciated.

Forgot to mention, "RRULE:{10}" would actually be something like "RRULE:FREQ=YEARLY".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号