以下代码适用于没有重新出现的约会。通过工作正常,我的意思是当我使用此代码发送电子邮件时,它会在正确的时间段内,在正确的日期显示在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”。