Is it possible to read Outlook Exchange Calendar?
I have an application I'm working on at work that randomly generates assignments each day to my team of 16 people. 11 assignments for 16 possibilities. Some days, obviously, people are on vacation or sick, etc. and some people don't work Mon-Fri, so we don't always have 16.
I have a separate module that my supervisor can use to setup each employee's weekly schedule - i.e. Jack works Mon-Fri, Tim works Tue-Fri.
The random generator works fine. My fallback is with Outlook 2003 Calendar.
What I need is to be able to read the Calendar (basically, convert the "appointment" data to text and parse it). Once I can get that data to a form I can work with, I can do what I need to do...but I don't know how to search the Calendar and grab that data using AHK. Is it possible? Am I being clear here?
Fred works Mon-Fri. He requested off for vacation on Thu and Fri. His manager enters this into the calendar for Thu and Fri: Fred - Vacation.
-- If it is possible to read the Calendar, I would have my manager & supervisor put an indicator on the entries for our team. i.e. "&& Fred - Vacation." so that I can search for the &&.
Also, another good reason for this is that once the assignment schedule is created, if there are any modifications to the Outlook Calendar (i.e. call-outs), I can have it notify whoever is the backup for that day that an assignment needs to be reassigned.
see wikipedia for ics format,this is an example of one entry in a calendar in icalendar export format
SUMMARY:Bastille Day Party
1. an automated process that will pull data (Multiple times per day) from the Shared Calendar
2. to be able to parse this data (I can figure out the parsing once the data is pulled off the Calendar)
3. so I can update my application with current schedule data.
Is this feasible? Is there an easier way to get the data down to a usable format for my AHK application?
In general terms here's the code for manipulating an appointment in a calendar folder. Since you weren't specific about what you need I've shown how to open a calendar folder, loop through the entries in a calendar, and add an appointment to a calendar. 'In your project include a reference to Microsoft Outlook x.x Object Library 'where x.x is your version of Outlook Dim objApp As Outlook.Application, _ objNS As Outlook.NameSpace, _ objCalendar As Outlook.MAPIFolder, _ objAppointment As Outlook.AppointmentItem Set objApp = CreateObject("Outlook.Application") Set objNS = objApp.GetNamespace("MAPI") 'Change OutlookProfileName to the name of your Outlook profile objNS.Logon "OutlookProfielName" Set objCalendar = objNS.GetDefaultFolder(olFolderCalendar) 'To access each appointment in the calendar do this For Each objAppointment In objCalendar.Items 'Code to do whatever you want to do with each appointment Next 'To add an appointment do this Set objAppointment = objApp.CreateItem(olAppointmentItem) With objAppointment .Body = "Some text" .BusyStatus = olBusy .Start = #6/9/2005 6:00:00 AM# .Duration = 60 .Subject = "My Appointment" .Save End With