Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outlook error trapping
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01620408
Message ID:
01620409
Vues:
51
>I am using the following simple code to send a batch of emails based
>on a file with records containing an email address (act_email) and a
>file name (mfilename).
>
>My issue is that occasionally the operator entering the email addresses will
>make a mistake and enters a blank as the first digit or two @ signs, etc. This causes
>an error to be generated and the program halts.
>
>Is there a simple way if an error is generated to just skip to the next record? Obviously,
>an On Error with a retry will not work, but I'm sure an On Error function of some sort is
>the key to the solution. Something as simple as the On Error forcing the code to advance to
>the next line could solve the problem.
>
>If anyone has any ideas, they would be appreciated.
>
>Brad
>
>sele feml
>do while .not. eof()
> memail = alltrim(act_email)
> mfile = "c:\transfer\"+alltrim(mfilename)
>**********************************************************
> o=createobject("outlook.application")
> oitem=o.createitem(0)
> oitem.subject="This is the subject"
> oitem.to = memail
> oitem.body="See attachment for important information"
> oitem.Attachments.Add(mfile)
> oitem.send
> o=.null.
>***********************************************************
> sele feml
> skip
> loop
>enddo

Brad, you need to read the help for TRY ... CATCH ... ENDTRY

.
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform