Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No access to somebody's mailbox
Message
From
12/10/2000 22:29:06
 
 
To
11/10/2000 04:38:15
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00427729
Message ID:
00428869
Views:
20
>#DEFINE olFolderInbox 6
>
>When another user gives you NO access to his mailbox and I try to go to his mailbox, how can I intercept the error i get (OLE IDispatch exception code 4096 from Microsoft Outlook). I use the following code:
>
>oOutlook = CREATEOBJECT("Outlook.Application")
>oNameSpace = oOutlook.GetNameSpace("MAPI")
>
>oUser = oNameSpace.CreateRecipient("MICHAEL")
>
>oInbox = oNameSpace.GetSharedDefaultFolder(oUser,olFolderInbox)
>
>FOR EACH oInbox IN oInbox.Items && The error occurs here

And the problem is there - you're creating an instance variable oInBox that's overwriting the source object (which you've named oInBox). Try something like:

FOR EACH oInBoxItem IN oInBox.Items

and within the loop, reference the instance variable oInBoxItem. Don't hurt yourself needlessly...VFP will do exactly what you want it to, with all the bad consequences imaginable.

>
>endfor
>
>Thanks in advance
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform