Exporting Outlook calendar as .ical/ics
Posted 05-13-2011 at 06:36 AM by catkin
Hello
This falls into two steps: firstly exporting an Outlook calendar as .ical files and secondly turning those .ical files into a .ics file.
The technique was used with Outlook 2003 running on Windows XP (as part of a migration to Xfce's calendar, Orage). It probably works with other versions and OSes too.
Thanks and acknowledgements to BlueDevilFan who posted the original VBA macro at Experts Exchange where it is no longer visible (but may be after subscribing).
In Outlook ...
Tools → Macro → Security and note the Security Level for later restore. Set the Security Level to Medium.
Tools → Macro → Visual Basic Editor. If Modules/Module1 is not displayed, right-click" Project1" then "Insert Module". Open Modules/Module1. In the VBA editor, in Module1, create this macro, changing <drive>:<path> as required (best use an empty folder):
In Outlook, open the Calendar then Tools → Macro → Macros. If you get a Security Warning, click Enable Macros. Select ExportToiCal and click Run. Depending on the system it will take around 1 minute per 200 calendar entries. The GUI may flicker and develop empty rectangles while the macro is running.
When ExportToiCal has finished: Tools → Macro → Security and restore the original Security Level.
The individual Appt-<n>.ical files may now be turned into a .ics file by simple concatenation. This may be done on a Linux-based system by:
Outlook-specific data can be removed by:
This falls into two steps: firstly exporting an Outlook calendar as .ical files and secondly turning those .ical files into a .ics file.
The technique was used with Outlook 2003 running on Windows XP (as part of a migration to Xfce's calendar, Orage). It probably works with other versions and OSes too.
Thanks and acknowledgements to BlueDevilFan who posted the original VBA macro at Experts Exchange where it is no longer visible (but may be after subscribing).
In Outlook ...
Tools → Macro → Security and note the Security Level for later restore. Set the Security Level to Medium.
Tools → Macro → Visual Basic Editor. If Modules/Module1 is not displayed, right-click" Project1" then "Insert Module". Open Modules/Module1. In the VBA editor, in Module1, create this macro, changing <drive>:<path> as required (best use an empty folder):
Code:
Sub ExportToiCal() Dim olkFolder As Outlook.Items, _ olkAppointment As Outlook.AppointmentItem, _ intCount As Integer intCount = 1 Set olkFolder = Application.ActiveExplorer.CurrentFolder.Items For Each olkAppointment In olkFolder 'Edit the path and filename on the following line as needed olkAppointment.SaveAs "<drive>:<path>\Appt-" & intCount & ".ical", olICal 'or olVcal if you prefer intCount = intCount + 1 Next Set olkAppointment = Nothing Set olkFolder = Nothing MsgBox "All done." End Sub
When ExportToiCal has finished: Tools → Macro → Security and restore the original Security Level.
The individual Appt-<n>.ical files may now be turned into a .ics file by simple concatenation. This may be done on a Linux-based system by:
Code:
cat Appt-*.ical > Appt-all.ics
Code:
sed '/^ATTACH/ d' Appt-all.ics | sed '/^PRODID/ d' | sed '/X-MICROSOFT/ d' > Appt-all.filtered.ics
Total Comments 0