Avatar of SparkyP
SparkyP asked on

Outputting from Access to Outlook Shared Calendar

The following code puts Job details into MY outlook calendar (and obviously into the Calendar of any users who create the record).

What I need is for the Calendar entry to go into my colleague Dan's shared calendar, regardless who creates the entry.

We are using Access 2010, Outlook 2010 and Exchange server 2003.

Hope you can help.

Private Sub Work_Date_AfterUpdate()
    Dim oApp As Object
    Dim oNS As Object
    Dim oCalendar As Object
    Dim ofold As Object
    Set oApp = CreateObject("Outlook.Application")
    Set oNS = oApp.GetNamespace("MAPI")
    Set oCalendar = oNS.GetDefaultFolder(9)
        Set ofold = oCalendar.Items.Add
             With ofold
                    .Subject = Me!engName & " to " & Forms![Job Reports]!Site & " SR " & Forms![Job Reports]![Job Number ID] & " - " & Forms![Job Reports]![Work Request Details]
               .Start = Forms![Job Reports]![Date] 'start date/time of entry
               .Duration = 30
               .ReminderMinutesBeforeStart = 1440 'minutes in a day
        .Save
    End With
        Set oCalendar = Nothing
    Set oApp = Nothing
End Sub
VB ScriptMicrosoft AccessOutlook

Avatar of undefined
Last Comment
SparkyP

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
mbizup

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
mbizup

Also, read the comments about that code -- it is dependent on permissions, so it will not work unless you have the proper permissions to write to that other user's calendar.
ASKER
SparkyP

Thank you for coming up with the goods once again.

Had found the code, but the Late Binding tips got it to work.

Have a good weekend.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes