troubleshooting Question

MS Access VBA -- How to use OlMeetingStatus & olMeetingCanceled (These are MS Outlook objects)

Avatar of RiverWalk
RiverWalk asked on
Microsoft AccessOutlook
5 Comments1 Solution942 ViewsLast Modified:
I have VBA code that pulls Outlook calendar data out of Outlook and into an MS Access table, but it is retreiving cancelled/deleted meetings. I found a reference to OlMeetingStatus & olMeetingCanceled at the below link but I don't understand how to use them.

I don't know if OlMeetingStatus represents another field I can pull into Access out of the Outlook calendar, in the manner shown by the below code, or if it's something else.  I either need to exclude the canceled meetings from being pulled into Access or pull them into access along with a field that will identified which ones have been canceled. Can you please help?

I have included a code example of how I'm pulling the data out of Outlook. This is not the entire code section, but enough possibly to show you what I'm talking about.

Set olItems = olFldr.Items
  iNumItems = olItems.Count
  Set db = CurrentDb
  'Commenting this line out because I do this deletion in the code that calls this function. Don't need to do it again here.
  'db.Execute "Delete * from OutlookAppointments", dbFailOnError
  Set rs = db.OpenRecordset("OutlookAppointments")
  For i = 1 To iNumItems
    If TypeName(olItems(i)) = "AppointmentItem" Then
      Set olAppt = olItems(i)
      With olAppt
        rs!EntryID = .EntryID
        rs!StartTime = .Start
        rs!EndTime = .End
        rs!Duration = .Duration
        rs!Subject = .Subject
        rs!Location = .Location
        rs!Organizer = .Organizer
        rs!RequiredRecipients = .RequiredAttendees
        rs!OptionalRecipients = .OptionalAttendees
        'rs!Body = .Body
        ' For user-defined properties:
        ' rs!FieldName = .UserProperties("PropertyName")
        iCount = iCount + 1
      End With
    End If
  Next i

Thank you!
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros