gfcaim Posted July 1, 2010 Posted July 1, 2010 I'm trying to learn the language, and of course error handling is a big part. I have an error handler working using 'objevent' but want to capture specific events. The help file states "To receive a specific event, create an AutoIt function name using the given prefix appended with the event name." but I don't follow what is meant... Could some one please advise (I have searched the forum and read stuff but its not sinking in ) Is there any descent tutorials that wil enlighten me? [font="Comic Sans MS"]"I'm not usually a praying man, but if you are up there, please save me Superman!" (Homer J. Simpson)[/font]
Mat Posted July 1, 2010 Posted July 1, 2010 That info is for objects, so is useless to do what you want it to do. Read up about the @error flag in the helpfile. That is the main way to do error checking in AutoIt AutoIt Project Listing
gfcaim Posted July 1, 2010 Author Posted July 1, 2010 That info is for objects, so is useless to do what you want it to do.Read up about the @error flag in the helpfile. That is the main way to do error checking in AutoItThanks Mat, thats really helpful and got me going again [font="Comic Sans MS"]"I'm not usually a praying man, but if you are up there, please save me Superman!" (Homer J. Simpson)[/font]
gfcaim Posted July 2, 2010 Author Posted July 2, 2010 Sorry to bring this up again chaps, but I'm afraid I'm not getting it The error would occur on the '.send' line (if, for example, the email address was invalid) but thats where it bombs out so doesn't actually continue to the next line... Func SendEmail($eTo,$eCC,$eSubj,$eBody) Local $olMailItem = 0 Local $olByValue = 1 $oOApp = ObjCreate("Outlook.Application") $oOMail = $oOApp.CreateItem ($olMailItem) $Res=true With $oOMail .To = $eTo .CC = $eCC .Subject = $eSubj .Body = $eBody .BodyFormat = 2;Plain=1, HTML=2, RichText=3 .Importance = 1;Low=0, Normal=1, High=2 .Send if @error=0 then $res=True Else $res=False EndIf EndWith $oOApp=0 EndFunc [font="Comic Sans MS"]"I'm not usually a praying man, but if you are up there, please save me Superman!" (Homer J. Simpson)[/font]
water Posted July 2, 2010 Posted July 2, 2010 Please have a look at the Outlook UDF. The function _OutlookSendMail should give you an idea how it works. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now