Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
When cancelled email getting error.
Message
From
20/05/2003 09:58:39
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
When cancelled email getting error.
Miscellaneous
Thread ID:
00790430
Message ID:
00790430
Views:
64
The following program i use for outlook function for sending emails.

When this program runs it checks for the name which is .oleMessage.RecipDisplayName

If it doesn't find the name in the address book it says the name not found in the address book would you like to add the name to Address book or cancel.

When i say cancel i get the error. Is there a way to skip the error smoothly and come back to program again.

********************This is the code********************************

WAIT WINDOW NOWAIT "Please wait ... Logging Into Mail" NOCLEAR

WITH thisformset.basicform1
PUBLIC array ErrorArray(1)
PUBLIC mapierror
local lcCRLF
* Define constant

lcCRLF = CHR(13) + CHR(10)

MapiError = -1
STORE "" to ErrorArray
ON ERROR DO "PROGRAMS\mapierror"

* Signon to mail if user is not already signed in

IF NOT .oleSession.SessionID > 0
.oleSession.Signon
ENDIF

* If the session ID is not valid, do not allow the form to load
IF .oleSession.SessionID > 0
WAIT clear
.oleMessage.SessionID = .oleSession.SessionID
* Start a new message
.oleMessage.Compose
.oleMessage.RecipIndex = 0
.oleMessage.AddressResolveUI = .T.
.oleMessage.RecipDisplayName = ALLTRIM(sub_revw.reviewer)
.oleMessage.ResolveName
IF UPPER(ALLTRIM(sub_revw.reviewer)) <> UPPER( .oleMessage.RecipDisplayName)
REPLACE sub_revw.reviewer WITH .oleMessage.RecipDisplayName
ENDIF
IF MapiError = 30021
MESSAGEBOX("E-mail Canceled")
ELSE
.oleMessage.MsgSubject = "Reviewer Action Item for "+sub.Project_no
.oleMessage.MsgNoteText = "following Submittal issued for merit review " +sub.Project_no+" "+sub.Workpkg_no
.oleMessage.Send(1)
ENDIF
ELSE
WAIT WINDOW "Form Cannot Load: Login Failed"
ENDIF
ON ERROR DO "PROGRAMS\errhand" WITH ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )
ENDWITH
WAIT CLEAR

*********************END*********************************

Thank you very much in advance.
Next
Reply
Map
View

Click here to load this message in the networking platform