Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
No access to somebody's mailbox
Message
De
12/10/2000 22:29:06
 
 
À
11/10/2000 04:38:15
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00427729
Message ID:
00428869
Vues:
18
>#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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform