Log in

View Full Version : Solved: Outlook - Export Appointments as Icalendars



gsdonald
09-14-2007, 02:54 AM
Hi there,
Does anyone know of a way to export a range of appointments into the Icalendar format?
It can be done on a one-to-one basis, but I'm sure there's a faster way using VBA.

Any help appreciated.

GSD

Charlize
09-14-2007, 05:14 AM
You could try this one. Beware, no errorchecking so I'm not sure if it will work in every possible situation.Sub export_selected_agenda()
'First show you agenda in listview
'view - active appointments instead of day, week, month view
'This will produce a list of future appointments.
'Select the ones you want and call this macro.
Const mypath As String = "C:\Data\Ical\"
Dim mycalitem As Outlook.AppointmentItem
If ActiveExplorer.Selection.Count = 0 Then Exit Sub
For Each mycalitem In ActiveExplorer.Selection
mycalitem.SaveAs mypath & Split(mycalitem.Start, "/")(2) & _
"-" & Split(mycalitem.Start, "/")(1) & _
"-" & Split(mycalitem.Start, "/")(0) & _
" - " & Split(mycalitem.End, "/")(2) & _
"-" & Split(mycalitem.End, "/")(1) & _
"-" & Split(mycalitem.End, "/")(0) & _
" - " & mycalitem & "-" & mycalitem.Subject & ".ics", Type:=olICal
Next mycalitem
End Sub

gsdonald
09-14-2007, 09:59 AM
Hey that's fantastic - it works a treat, thanks.