Exchange Rooms Calendar

  • Thread starter Thread starter Ron Paii
  • Start date Start date
R

Ron Paii

I created a Rooms Calendar in Exchange server and connected to it in Outlook
2010. I now want to use automation from MS Access 2010 to add an appointment
to this calendar. The problem is it don't show in the folders collection.
the oNameSpace.PickFolder dialog box does not show it. Does anyone know how
to access this type of calendar?
 
Ron Paii said:
I created a Rooms Calendar in Exchange server and connected to it in
Outlook 2010. I now want to use automation from MS Access 2010 to add an
appointment to this calendar. The problem is it don't show in the folders
collection. the oNameSpace.PickFolder dialog box does not show it. Does
anyone know how to access this type of calendar?

Solved: use GetSharedDefaultFolder from namespace

Dim oCalendar As Outlook.Folder
Dim oRecipient As Outlook.Recipient
Dim oAppointment As Outlook.AppointmentItem
Dim dStartDate As Date

Set oRecipient = oNameSpace.CreateRecipient("Company Calendar")

oRecipient.Resolve
If oRecipient.Resolved Then
Set oCalendar = oNameSpace.GetSharedDefaultFolder(oRecipient,
olFolderCalendar)
Set oAppointment = oCalendar.Items.Add("IPM.Appointment")
With oAppointment
.Subject = "Test"
.Body = "Hello World"
.Location = "Here"
dStartDate = DateAdd("d", 1, Now)
.Start = dStartDate
.End = DateAdd("h", 1, dStartDate)
.ReminderSet = True
.ReminderMinutesBeforeStart = 1
.BusyStatus = olBusy
.IsOnlineMeeting = False
.Save
End With
Else
MsgBox "Could not resolve: Company Calendar"
End If
 
Back
Top