Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Outlook USER selection problems
Message
 
 
To
10/09/2001 05:05:35
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00554547
Message ID:
00554566
Views:
10
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform