我遇到了生成的iCal文件的問題。Outlook未在ics文件中導入多個事件
它似乎正確生成代碼和文件的.ics裝載有多個事件,但是當我在Outlook中打開該文件只導入第一個事件到我的日曆,並且不添加其餘部分。
這裏是生成的iCal文件
BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
X-WR-CALNAME: Calendar
CALSCALE:GREGORIAN
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VTIMEZONE
TZID:Europe/London
BEGIN:DAYLIGHT
TZOFFSETFROM:+0000
TZOFFSETTO:+0100
DTSTART:19810329T010000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
TZNAME:BST
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0100
TZOFFSETTO:+0000
DTSTART:19961027T020000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
TZNAME:GMT
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART:20140906T090000
DTEND:20140906T170000
UID:224
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Explore the College with current students\, chat with the Director of Studies in your subject\, meet our admissions tutors\,
URL;VALUE=URI:http://www.domain.com/events-224
SUMMARY:Open Day (undergraduate)
END:VEVENT
BEGIN:VEVENT
DTSTART:20141208T000000
DTEND:20141212T000000
UID:416
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Admissions Interviews
URL;VALUE=URI:http://www.domain.com/events-416
SUMMARY:Admissions Interviews
END:VEVENT
BEGIN:VEVENT
DTSTART:20141215T000000
DTEND:20141218T000000
UID:417
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Admissions Interviews
URL;VALUE=URI:http://www.domain.com/events-417
SUMMARY:Admissions Interviews
END:VEVENT
BEGIN:VEVENT
DTSTART:20150112T000000
DTEND:20150116T000000
UID:419
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Admissions Interviews
URL;VALUE=URI:http://www.domain.com/events-419
SUMMARY:Admissions Interviews
END:VEVENT
BEGIN:VEVENT
DTSTART:20150314T000000
DTEND:20150314T000000
UID:67
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Explore the College with current students\, chat with the Director of Studies in your subject and meet our admissions tutors.
URL;VALUE=URI:http://www.domain.com/events-67
SUMMARY:Admissions Open Day (Arts)
END:VEVENT
BEGIN:VEVENT
DTSTART:20150425T000000
DTEND:20150425T000000
UID:73
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Explore the College with current students\, chat with the Director of Studies in your subject and meet our admissions tutors.
URL;VALUE=URI:http://www.domain.com/events-73
SUMMARY:Admissions Open Day (Sciences)
END:VEVENT
END:VCALENDAR
下面是設置的iCal文件
$iCalHeader = "" .
"BEGIN:VCALENDAR\n" .
"PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN\n" .
"VERSION:2.0\n" .
"METHOD:PUBLISH\n";
$iCalHeaderBottom = "CALSCALE:GREGORIAN\n" .
"X-MS-OLK-FORCEINSPECTOROPEN:TRUE\n" .
"BEGIN:VTIMEZONE\n" .
"TZID:Europe/London\n" .
"BEGIN:DAYLIGHT\n" .
"TZOFFSETFROM:+0000\n" .
"TZOFFSETTO:+0100\n" .
"DTSTART:19810329T010000\n" .
"RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU\n" .
"TZNAME:BST\n" .
"END:DAYLIGHT\n" .
"BEGIN:STANDARD\n" .
"TZOFFSETFROM:+0100\n" .
"TZOFFSETTO:+0000\n" .
"DTSTART:19961027T020000\n" .
"RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU\n" .
"TZNAME:GMT\n" .
"END:STANDARD\n" .
"END:VTIMEZONE\n";
$iCalFooter = "END:VCALENDAR";
最後的代碼生成事件的頁眉和頁腳的變量
$iCal .= "BEGIN:VEVENT\n".
"DTSTART:" . date('Ymd\THis', strtotime($row2["EVENT_StartDateTime"])) ."\n".
"DTEND:" . date('Ymd\THis', strtotime($row2["EVENT_EndDateTime"])) . "\n".
"UID:" . $row2["EVENT_ID"] . "\n".
"DTSTAMP:" . date('Ymd\THis', time()) . "\n".
"LOCATION:$address\n".
"DESCRIPTION:" . $this->escapeString($description) . "\n".
"URL;VALUE=URI:http://www.domain.com/events-" . $row2["EVENT_ID"] . "\n".
"SUMMARY:" . $this->escapeString($title) . "\n".
"END:VEVENT\n";
它適用於第一個事件,所以我不認爲這是與鱈魚有問題這是爲每個事件生成的,我已經做了一些研究,但似乎無法找到解決方案,是否需要在每個事件之間使用額外的語句?
也許Outlook不支持在單一的iCal多個事件,因此只導入第一個?
任何幫助或建議將不勝感激。
在此先感謝。
看來,Outlook將不會導入打開Outlook中的iCal文件時,但是,使用導入功能將整個拉的所有事件進行多次約會,雖然這不是我的理想迄今無法得到它拉通過使用outlook打開文件的所有事件。 –
你添加了一個組織者嗎?它改變了什麼嗎?你會考慮接受我的答案嗎? – bbsimonbb