Exchange Rooms Calendar

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?
 
R

Ron Paii

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top