Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Trapping e-mail OLE errors
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??
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement