Import shared calendar into Access - Microsoft Community


i working on planning tool company. tool build in access. need import shared calendar check availability of colleagues.

i have following working code. imports appointments personal agenda , places in local access table:

private sub command2_click()

    dim outlook outlook.application
    dim namespace outlook.namespace
    dim root outlook.mapifolder
    dim cal outlook.mapifolder
    dim accepted string
    dim olrecipient outlook.recipient
    dim item object
    dim appt outlook.appointmentitem
    dim rs adodb.recordset

    set outlook = new outlook.application
    set namespace = outlook.getnamespace("mapi")
    set root = namespace.getfolderfromid("000000002a403f4f7dc7324983a7a3a8e07323d1ec3c17f0000000001080000")
    set cal = root.folders.item("agenda")

    set rs = new adodb.recordset
    rs.activeconnection = currentproject.connection
    rs.open "appointments", , adopendynamic, adlockoptimistic

    each item in cal.items
        set appt = item

        rs.addnew
        rs("start") = appt.start
        rs("end") = appt.end
        rs("subject") = appt.subject
        rs("location") = appt.location
        rs("duration") = appt.duration
        rs("organizer") = appt.organizer
        rs("attendees") = appt.accepted
        rs.update

    next item

    rs.close

    msgbox "appointments added"

end sub

what need import appointments in shared calendar (see attached image).

i tried working with...

getshareddefaultfolder("recipient",outlook.oldefaultfolders.olfoldercalendar)

e.g.

set outlook = new outlook.application set namespace = outlook.getnamespace("mapi") set olrecipient = namespace.createrecipient("collegue name") set cal = namespace.getshareddefaultfolder(olrecipient, olfoldercalendar) olrecipient.resolve

...and different recipient objects can't work. tips appreciated.



Office / Access / Microsoft Office Programming / Office 2010



Comments

Popular posts from this blog

Getting ErrorCode: 120018 when trying to access Microsoft account - Microsoft Community

The message was sent to a distribution list ‎(DL)‎ - Microsoft Community

Activation Error 0x8004FE93 - Microsoft Community