Copying Outlook calendar appointments to a 2010 Access table RRS feed

  • Question

  • I have a 2010 Access database that stores and reports on meetings stored in my calendar. When I attach to the calendar in access, I do not get the appointment date/time. I only get fields about attendees, meeting name etc. I want to build an append query or something similar to copy meetings either based on dates or some other criteria, but without having the actual appointment date/time in the calendar makes the information useless.

    I posted this in the access developers area and they said they moved it. I presume it is here somewhere, but I could not find it. Any help on this would be greatly appreciated. I have downloaded several articles on attaching to Outlook data through access or vba, but I haven't found anything that I can use. 

    In code, I assume that I would create a dao recordset and loop through the calendar, but I don't know where the appointment information is.

    Dean J. Waring

    Tuesday, March 31, 2015 2:36 PM


  • Hi,

    as a quick sample try this:

    Public Sub test()
    Dim olApp As Object, olNS As Object, olFolder As Object, olItem As Object, i%
    Set olApp = CreateObject("Outlook.Application")
    Set olNS = olApp.GetNameSpace("MAPI")
    Set olFolder = olNS.GetDefaultFolder(olFolderCalendar)
    Set olItem = olFolder.Items.GetFirst
    For i = 1 To olFolder.Items.Count
        Debug.Print "Subject: " & olItem.Subject & " Start: " & olItem.Start & " End: " & olItem.End
        Set olItem = olFolder.Items.GetNext
    Next i
    End Sub

    Andrey V Artemyev | Saint-Petersburg, Russia

    Wednesday, April 1, 2015 6:58 AM