Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trapping e-mail OLE errors
Message
From
18/01/2000 03:22:11
 
 
To
17/01/2000 06:22:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00318878
Message ID:
00319328
Views:
13
My onerror statement is something like:

ON ERROR DO screrror WITH MESSAGE(),MESSAGE(1),PROGRAM(), LINENO(),ERROR()

When the mapisession login fails I get the following text in the parameter message():

«OLE IDispatch exception code 0 from MAPISession: Login has failed..»

And the error number is 1429 as all errors with OLE.

In the init of the form called by the on error statement, I check to see if the error is 1429 and has the description above and I do what I want.



>How can I trap log on errors within an error trap?
>
>I have an error form where the user enters who they are, where they are and a some comments. This info can then be faxed or e-mailed back to us so that it can be fixed. The problem I have is trapping the OLE error if they are not logged on or if they choose to cancel the logon. As this is already within the 'on error' then another error trap to set an error flag is ignored. Is there any way of trapping the OLE errors while using e-mail?
>
>By the way this routine works well else where in the app (i.e. registration).
>
>Here's the code and potential errors that could occur.
>
>* Create a mapi session
>objSession = createobject( "mapi.session")
>
>* Store the current error status and set an error flag if something goes wrong
>lcOldErr = on( "error" )
>on error llError = .t.
>
>* Logoon on to the current session without any dialog
>* An error will occur here if e-mail is not open or loged in
>objSession.Logon( .null., .null., .f., .f.)
>
>if llError
> * If an error occured while logging on automatically
> * - present the logon dialog
> * An error can occure here if the user cancels the log on
> objSession.Logon()
>endif
>
>on error &lcOldErr
>
>Any ideas??
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform