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.AddNew 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") rs.Update iCount = iCount + 1 End With End If Next i
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”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.