Search the Community
Showing results for tags 'Error Handler'.
Found 2 results
Hi Guys, I'm writing a script that loops through all the word documents in a given folder and inserts text into the footer. This is mostly working great. I have run into a problem where the footer in a few documents is somehow protected. If I open word manually I can select the text in the footer but I can't add to it. I can update the main text in the document so it isn't simply password protected. Rather than try and unprotect it I'm happy just to skip over it. I currently get an error on the line shown below $oRange.Inserafter ; Insert the text $oRange.Insertafter($text1 & $LastSavedDay &'/'& $LastSavedMonth &'/'& $LastSavedYear & $text2) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Insert Modified Date", _ "Error 010 Setting first footer InsertAfter location" & $file & @CRLF & "@error = " & @error & ", @extended = " & @extended) "E:\FileConversion\InsertCreationDate2.au3" (120) : ==> The requested action with this object has failed.: $oRange.Insertafter($text1 & $LastSavedDay &'/'& $LastSavedMonth &'/'& $LastSavedYear & $text2) $oRange^ ERROR It stops at the above line and does not get to the @error statement. I guess what I really need is to catch this error and jump to the next document in my for next loop. I'm happy to add the entire script to this post if anyone thinks that will help. Any Ideas? David
I have created some scripts using IE.au3 but i havent implemented any good error handling logic yet. In case of any errors IE.au3 prints the errors in the console. I believe those errors are printed to console using __IEErrorNotify function. I want to use these error messages and insert those into a text file or an excel. Any ideas? Basically if error messages are generated from IE.au3 after accessing its functions, then i want to write them to a file.