rebol [ Title: "Outlook Calendar" File: %outlook-calendar.r Date: 9-Jul-2006 Version: 1.0.3 Progress: 0.15 Status: "working" Needs: [] Author: "Anton Rolls" Language: 'English Purpose: {Extract data from Outlook Calendar} Usage: {} History: [ 1.0.0 [4-Dec-2005 {First version} "Anton"] 1.0.1 [13-Dec-2005 {} "Anton"] 1.0.2 [29-Jun-2006 {revising for reengineered COMLib.r} "Anton"] 1.0.3 [9-Jul-2006 {revised for reengineered COMLib.r} "Anton"] ] ToDo: { - Extract the Outlook Calendar data } Notes: { http://www.outlookcode.com/d/tips/gethelp.htm 1. Press Alt+F11 to open the VBA environment. 2. Press F2 to display the Object Browser. 3. If you're in Word or Excel VBA, choose Tools | References, and add the Microsoft Outlook library to the project. 4. At the top of the Object Browser, switch from viewing to Outlook. Some code that helped me: http://www.microsoft.com/technet/scriptcenter/resources/officetips/archive.mspx http://www.microsoft.com/technet/scriptcenter/resources/officetips/apr05/tips0405.mspx http://www.microsoft.com/technet/scriptcenter/resources/officetips/sept05/tips0901.mspx http://support.microsoft.com/?kbid=290792 http://www.outlookcode.com/threads.aspx?forumid=4&messageid=15144 http://www.outlookcode.com/codedetail.aspx?id=43 } ] if error? set/any 'error try [ ; catch all errors do/args %../COMLib.r [ outlook-app: CreateObject "Outlook.Application" ; bind to the current instance of Outlook (assumed to be already running) outlook-ns: GetObject [outlook-app ".GetNamespace(%s)" "MAPI"] outlookFolder: GetObject [outlook-ns ".GetDefaultFolder(%d)" 9] ; 9 = olFolderCalendar ;probe GetString [outlookFolder ".Name"] ; == "Calendar" Appointments: EnumBegin [outlookFolder ".Items"] ; a collection of appointments (and maybe other things?) count: 0 while [not zero? Appointment: EnumNextObject [Appointments]][ class: GetInteger [Appointment ".Class"] either class = 26 [ ; 26 = olAppointment foreach attr [ ".ConversationTopic" ".Location" ".Start" ".Duration" ".Subject" ".Body" ".ReminderSet" ".ReminderMinutesBeforeStart" ][ print [tab attr mold GetString [Appointment attr]] ] ;print "saving Appointment..." ;CallMethod [Appointment ".SaveAs(%s,%d)" rejoin ["D:\outlook-appointment" count: count + 1 ".txt"] 0] print "--------" ][ print ["Warning!! unhandled class:" class] ] release Appointment ] release Appointments release outlookFolder release outlook-ns release outlook-app ] ][ print mold disarm error ]