Shared Calendar Folder Access

  • Thread starter Thread starter willkelleher
  • Start date Start date
W

willkelleher

Hi all,

I'm trying to write a program that analyzes appointments in several
shared calendars. I know how to use the default shared calendar, but
how does one specify a shared calendar by the AD name of the calendar
owner?

I'm new to Outlook VBA, so please show mercy on me. :)

Thanks,

Will
 
Hi Will. The GetSharedDefaultFolder method is what you want to use. Here's
some sample code from the Outlook VBA help file that should set you on your
way. If you need more help, let me know.

Sub ResolveName()
Dim myOlApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myRecipient As Outlook.Recipient
Dim CalendarFolder As Outlook.MAPIFolder
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myRecipient = myNamespace.CreateRecipient("Dan Wilson")
myRecipient.Resolve
If myRecipient.Resolved Then
Call ShowCalendar(myNamespace, myRecipient)
End If
End Sub

Sub ShowCalendar(myNamespace, myRecipient)
Dim CalendarFolder As Outlook.MAPIFolder
Set CalendarFolder = _
myNamespace.GetSharedDefaultFolder _
(myRecipient, olFolderCalendar)
CalendarFolder.Display
End Sub


--
Eric Legault - MVP - Outlook
MCDBA, MCTS (Messaging & Collaboration, SharePoint Infrastructure, WSS 3
Application Development, MOSS 2007 Application Development)
Blog: http://blogs.officezealot.com/legault
Try Picture Attachments Wizard for Outlook!
http://www.collaborativeinnovations.ca
 
Back
Top