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
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of mbizup
mbizup
Flag of Kazakhstan image

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.
Avatar of SparkyP
SparkyP

ASKER

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.
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo