GetSharedFolder()

  • Thread starter Thread starter Chrisy H
  • Start date Start date
C

Chrisy H

Hi,
I'm using a VB6 program to connect to a default folder:
Y = GetDefaultFolder(olFolderinbox)
But I would like to connect to a shared folder (another
users mailbox).
I'm trying to use the GetSharedFolder Function But I'm
having some trouble with the syntax (Recipient).
Can sombody Please help.
 
From the Object Browser Help on that method:

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
Set myRecipient = myNameSpace.CreateRecipient("Kim Buhler")
myRecipient.Resolve
If myRecipient.Resolved Then
Set KimCalendarFolder = _
myNameSpace.GetSharedDefaultFolder _
(myRecipient, olFolderCalendar)
End If

An alternative to using CreateRecipient is to create a dummy mail item
and add the person you want as a Recipient to that, then get the
resolved Recipient object and use it in the GetSharedDefaultFolder
method.

The key thing is the Recipient must be resolved to an entry in one of
your AddressLists.

A better place to post programming questions is the
microsoft.public.outlook.program_vba newsgroup.
 
Back
Top