Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outlook USER selection problems
Message
 
 
À
10/09/2001 05:05:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00554547
Message ID:
00554566
Vues:
8
>Hello,
>
>I have to access the e-mail INBOX of another user assuming I have all the rights. I have the user's name and I'm using Microsoft Exhange.
>
>I'm using the following code so far :
>
>oApp = CreateObject("Outlook.Application")
>olNameSpace = oApp.GetNameSpace("MAPI")
>oInbox = olNameSpace.GetDefaultFolder(6).Items
>
>Can anyone help please ???

GetDefaultFolder only works within the current user's Folder collection. In order to go outside of that, you need to use the GetSharedDefaultFolder method of the Namespace object. Ex.
#define olFolderInbox 6
oapp = createobject('Outlook.application')
ons = oapp.GetNamespace('MAPI')
orecipient = ons.CreateRecipient("SomeUserNameHere")
if orecipient.Resolve() then
   ofolder = ons.GetSharedDefaultFolder(orecipient,olFolderInbox)
   * do whatever you want here
endif
HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform