当我尝试使用 RRULE 属性时遇到问题

发布于 2024-11-15 08:37:23 字数 3402 浏览 0 评论 0原文

对于没有重复发生的约会,以下代码完全可以正常工作。工作正常,我的意思是当我使用此代码发送电子邮件时,它会在正确的时间段、正确的日期显示在 Outlook 日历上。服务器位于中央时区,最终用户位于各个时区。

        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:16010101T020000" & 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

但是,当我将以下行添加

            "RRULE:{10}" & vbCrLf &

到 VEVENT 部分时,TZOFFSETFROM 和 TZOFFSETTO 似乎被忽略。换句话说,当该事件添加到我的 Outlook 日历时,时间已经关闭。

所以,我的问题是,当使用 RRULE 属性时,为什么我的日历事件在导入 Outlook 时没有显示在正确的时间段,但当不使用 RRULE 属性时,时间是完美的?

任何想法或想法都将不胜感激。

忘了提及,“RRULE:{10}”实际上类似于“RRULE:FREQ=YEARLY”。

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:16010101T020000" & 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".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文