I need help urgently with a problem I am having in trying to access data in the Outlook calendar on my PC.
I am writing code which will eventually write out the data found in various appointemnts stored in the Outlook calendar to a CSV file.
While writing the code I encountered erros in obtaining values hheld in certain properties.
As an example, when trying to access the "Body" and "Categories" property of the AppointmentItem object an error "Runtime error 287: Application defined or object defined error" occurs.
I am not sure whether it is because an item might have no value in a certain property being "inspected" or not. I tried "NOT IsNull(xxxxxxxx)" but that still gave the same error.
In the code attached I am using the MsgBox dialogue simply to test for access to the properties.
I need to see values in each of the follwing properties: START SUBJECT CATEGORIES BODY
Any help would be greatly appreciated.
Dim myOLApp As Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myAppointments As Outlook.Items
Dim myItems As Outlook.Items
Dim MyItem As Object
Set myOLApp = CreateObject("Outlook.Application")
Set myNameSpace = myOLApp.GetNamespace("MAPI")
Set myAppointments = myNameSpace.GetDefaultFolder(olFolderCalendar).Items
Set myItems = myAppointments.Restrict("[start] >= '01/06/2007'")
For Each MyItem In myItems
MsgBox "Date: " + format(MyItem.Start,"dd/mm/yy")
MsgBox "Subject: " + MyItem.Subject
MsgBox "Categories: " + MyItem.Categories
MsgBox "Body: " + MyItem.Body
Set myOLApp = Nothing
Set myNameSpace = Nothing
Set myAppointments = Nothing
Set myItems = Nothing