COM Object: Microsoft Outlook
Purpose: Read and Write Appointments from calendar
System Requirements: Microsoft Outlook: tested with 2010 and 2007
Documentation: http://support.microsoft.com/kb/220595
Other Links: following is a translation of this vb.net script.
olFolderCalendar := 9 ; Outlook.OlDefaultFolders.olFolderContacts olFolderContacts := 10 ; get constants from visual studio olAppointmentItem = 1 profileName := "Outlook" Outlook := ComObjCreate("Outlook.Application") namespace := Outlook.GetNamespace("MAPI") namespace.Logon(profileName) calendar := namespace.GetDefaultFolder(olFolderCalendar) items := calendar.Items count := items.Count msgbox % "calendar items: " count item := calendar.Items(1) item1 := "subject: " item.Subject . "`n" item1 .= "Start: " item.Start . "`n" item1 .= "Duration: " item.Duration . "`n" item1 .= "Body: " item.Body "`n" msgbox % "item1" item1 date := "9/1/2010 9:00:00 AM" ; this works, although the recommended ; format is year/month/date ; hours:minutes:seconds AM/PM date := "2010/9/1 9:00:00 AM" msgbox % makeAppointment(Outlook, "auto", "autohotkey rocks", date, "60", "2") !r::reload !q::exitapp makeAppointment(outlook, subject, body, startTime, duration, busyStatus) { static olAppointmentItem = 1 , olFree = 0 , olTentative = 1 , olBusy = 2 , olOutOfOffice = 3 item := outlook.CreateItem(olAppointmentItem) item.Body := body item.BusyStatus := busyStatus ; olBusy msgbox % startTime item.Start := startTime ; 9/1/2010 9:00:00 AM item.Duration := duration ; 60 item.Subject := subject return item.save() ; warns about programmatic access with normal settings }