I'm setting up a program that needs to know when calender events have been reached. i.e. "Out to lunch" Staring 12:00 PM, Ending 1:00 PM.
I did find some code that referenced the Default folders but each time it did a "Set objExplorer = objFolder.GetEx plorer()" a new incidence of Outlook would startup. I do get the info I'm looking for, but would have zillions of Outlooks running this way.
TIA,
Ira
I did find some code that referenced the Default folders but each time it did a "Set objExplorer = objFolder.GetEx plorer()" a new incidence of Outlook would startup. I do get the info I'm looking for, but would have zillions of Outlooks running this way.
TIA,
Ira
Code:
Dim objFolder As Outlook.MAPIFolder
Dim objExplorer As Outlook.Explorer
Dim objSubFolder As Outlook.MAPIFolder
Dim objCalenderItem As Outlook.AppointmentItem
For Each objFolder In Outlook.Session.Folders
Set objExplorer = objFolder.GetExplorer()
For Each objSubFolder In objExplorer.CurrentFolder.Folders
If objSubFolder.DefaultItemType = olAppointmentItem Then
For Each objCalenderItem In objSubFolder.Items
Debug.Print objCalenderItem.Subject & ", " & objCalenderItem.Location
Debug.Print objCalenderItem.BusyStatus
Debug.Print objCalenderItem.Start
Debug.Print objCalenderItem.End
Next
End If
Next
Next