nitekram Posted November 26, 2015 Posted November 26, 2015 I see what you mean about maybe missing an alert - any suggestions, as I do not want to miss one - maybe, write them to a text file, and retrieve them from there, updating the GUI for anything new? Or would it be possible to have multiple calls to the same function - having more than one msgbox or in my case GUI show up for each new event?As for not appearing correctly: I am trying to allow the GUI to show the whole subject line, as that will be the width of the GUI window. When I try to add the length of the string to the GUI width size, it still cuts off, like maybe the StringLen does not work on $oOL_Item.Subject ? 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
water Posted November 26, 2015 Author Posted November 26, 2015 As AutoIt is single threaded you can't have multiple MsgBoxes/GUIs at the same time. Maybe create a GUI with a ListView in the mains cript and add a new entry for every new mail?I think the GUI width can't be easily calculated from the number of characters. M takes more place than an i. I know Melba has an UDF to calculate what you need (I think it is called StringSize). 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
nitekram Posted November 26, 2015 Posted November 26, 2015 Thanks...will test it out. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
nitekram Posted November 27, 2015 Posted November 27, 2015 Okay, after adding the code, I am starting to get crashes on the outlook object:err.description is: The operation failed.err.windescription: Exception occurred.err.number is: 80020009err.lastdllerror is: 0err.scriptline is: -1err.source is: Microsoft Outlookerr.helpfile is: err.helpcontext is: 0 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
water Posted November 27, 2015 Author Posted November 27, 2015 Unfortunately this is a general purpose error. Without the script line where it happens it is impossible to tell what goes wrong. 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
nitekram Posted November 27, 2015 Posted November 27, 2015 Here is another error...the script was the ol too familiar like 35632 - I will disable error checking and get the exact error line number err.description is: err.windescription: Variable must be of type 'Object'.err.number is: 000000A9err.lastdllerror is: 0err.scriptline is: -1err.source is: err.helpfile is: err.helpcontext is: 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
nitekram Posted November 27, 2015 Posted November 27, 2015 I did get another line number error, after the last error, had to go though about 5 msgboxes - Line 38860 - Subscript used on non-accessible variable. But the first error before I added the error checking was...38860 variable must be of Type "Object" Also , I have been getting email notifications, with no sender or subject - just blank (after that is when my script crashes with the one about Object not be declared...here is the link to my function. https://www.autoitscript.com/forum/topic/178927-listview-expand-items-automatically/#comment-1284397 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
water Posted November 27, 2015 Author Posted November 27, 2015 Your script has 38860 lines of code? Even with a lot of UDFs included this is rather huge. And not easy to debug. 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
nitekram Posted November 27, 2015 Posted November 27, 2015 My script does not have that many lines of code, but I do have lot of UDF's both from Autoit and ones that you or others have created. The big issue, is that I create the script on a VM, as I do not have access to install applications on my local computer - otherwise, I could get more information. But it was not until I started using this Outlook event that my program started to crash. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
water Posted November 27, 2015 Author Posted November 27, 2015 Not sure how to handle such a problem. Can you run your code uncompiled so we get at least the line number? 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
nitekram Posted November 27, 2015 Posted November 27, 2015 What do I need, as I have never done that before? Is there an exe that I can use with the parameter of the script name. That would make it a lot easier for me to check things locally. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
nitekram Posted November 28, 2015 Posted November 28, 2015 I circumvented our security, and downloaded and installed Autoit, yet I have not received an error while running it not compiled? 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
nitekram Posted November 28, 2015 Posted November 28, 2015 (edited) Here is what I got...it appears to be coming from the event?>Running AU3Check (3.3.14.2) from:C:\Program Files (x86)\AutoIt3 input:C:\VM_Shared\AutoIT\QTIP_NOC.au3+>09:56:50 AU3Check ended.rc:0>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\VM_Shared\AutoIT\QTIP_NOC.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop"C:\VM_Shared\AutoIT\AGC_ONLY.au3" (285) : ==> The requested action with this object has failed.:Local $aWidthSender = _StringSize($oOL_Item.SenderName)Local $aWidthSender = _StringSize($oOL_Item^ ERROR->13:00:16 AutoIt3.exe ended.rc:1+>13:00:16 AutoIt3Wrapper Finished.>Exit code: 1 Time: 1.1e+004 EDIT - forgot to add this...Here is my function...I do create the the outlook object and the event at the beginning of my script...but here is the function. expandcollapse popup; Outlook 2007 - NewMailEx event - http://msdn.microsoft.com/en-us/library/bb147646%28v=office.12%29.aspx Func oOApp_NewMailEx($sOL_EntryId) If @UserName = 'UserName' Then Local $oOL_Item = $oOApp.Session.GetItemFromID($sOL_EntryId, Default) #cs MsgBox(64, "OutlookEX UDF Example Script", "New mail has arrived!" & @CRLF & @CRLF & _ "From: " & $oOL_Item.SenderName & @CRLF & _ "Subject: " & $oOL_Item.Subject) #ce Local $hNewMail = '' $hNewMail = WinActive("[active]", "") ;MsgBox('','', $hNewMail) Sleep(200) Local $aWidthSender = _StringSize($oOL_Item.SenderName) Local $aWidthSubject = _StringSize($oOL_Item.Subject) If $aWidthSender[2] = '' And $aWidthSubject[2] = '' Then Return Local $sbString = StringToBinary($oOL_Item.Subject) ClipPut($sbString) MsgBox('', 'Added to clipboard', 'Subject was added to clipboard') Local $sSenderName = $oOL_Item.SenderName Local $sSubject = $oOL_Item.Subject Local $hGUI = GUICreate('New Outlook Email Alert', $aWidthSubject[2] + 400, 200, -1, -1, $WS_SIZEBOX, $WS_EX_TOPMOST) Local $idOK = GUICtrlCreateButton("OK", 110, 160, 85, 25) GUISetState(@SW_SHOW, $hGUI) Local $idListview = GUICtrlCreateListView("From|Subject", 10, 10, $aWidthSubject[2] + 380, 110) GUICtrlSetFont($idListview, Default, Default, Default, "Consolas") ; Monospaced font GUICtrlCreateListViewItem($sSenderName & '|' & $sSubject, $idListview) _GUICtrlListView_SetColumnWidth($idListview, 0, $LVSCW_AUTOSIZE) _GUICtrlListView_SetColumnWidth($idListview, 1, $LVSCW_AUTOSIZE) ; Now resize the GUI and ListView to fit Local $iMaxWidth = 0 For $i = 0 To 1 $iMaxWidth += _GUICtrlListView_GetColumnWidth($idListview, $i) Next WinMove($hGUI, "", Default, Default, $iMaxWidth + 40) ; Just a quick approx - we can refine this ControlMove($hGUI, "", $idListview, 10, 10, $iMaxWidth + 25) ; tried this too ;WinMove($hGUI, "", Default, Default, $iMaxWidth + 40 + $aWidthSubject[2] + 400) ; Just a quick approx - we can refine this ;ControlMove($hGUI, "", $idListview, 10, 10, $iMaxWidth + 25 + $aWidthSubject[2] + 380) Sleep(200) WinActivate($hNewMail) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idOK GUISetState(@SW_HIDE, $hGUI) ExitLoop EndSwitch WEnd EndIf EndFunc ;==>oOApp_NewMailEx Edited November 28, 2015 by nitekram 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
nitekram Posted December 2, 2015 Posted December 2, 2015 @waterIs there anything I can do, to by pass these errors, as it appears that the function is being called without the proper info from Outlook? >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\VM_Shared\AutoIT\QTIP_NOC.au3" /UserParams +>15:06:10 Starting AutoIt3Wrapper v.15.920.938.0 SciTE v.3.6.0.0 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0409)+> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper>Running AU3Check (3.3.14.2) from:C:\Program Files (x86)\AutoIt3 input:C:\VM_Shared\AutoIT\QTIP_NOC.au3+>15:06:11 AU3Check ended.rc:0>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\VM_Shared\AutoIT\QTIP_NOC.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop"C:\VM_Shared\AutoIT\AGC_ONLY.au3" (274) : ==> The requested action with this object has failed.:Local $oOL_Item = $oOApp.Session.GetItemFromID($sOL_EntryId, Default)Local $oOL_Item = $oOApp.Session^ ERROR->06:47:27 AutoIt3.exe ended.rc:1 Turned on Com Error reporting and got this - followed by a crash of script.err.description is: The message you specified cannot be found.err.windescription: Exception occurred.err.number is: 80020009err.lastdllerror is: 0err.scriptline is: 285err.source is: Microsoft Outlookerr.helpfile is: err.helpcontext is: 0>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\VM_Shared\AutoIT\QTIP_NOC.au3" /UserParams +>06:48:34 Starting AutoIt3Wrapper v.15.920.938.0 SciTE v.3.6.0.0 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0409)+> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper>Running AU3Check (3.3.14.2) from:C:\Program Files (x86)\AutoIt3 input:C:\VM_Shared\AutoIT\QTIP_NOC.au3+>06:48:35 AU3Check ended.rc:0>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\VM_Shared\AutoIT\QTIP_NOC.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop"C:\VM_Shared\AutoIT\AGC_ONLY.au3" (288) : ==> Subscript used on non-accessible variable.:If $aWidthSender[2] = '' And $aWidthSubject[2] = '' Then ReturnIf $aWidthSender^ ERROR->07:08:37 AutoIt3.exe ended.rc:1+>07:08:37 AutoIt3Wrapper Finished.>Exit code: 1 Time: 1203 err.description is: The operation failed.err.windescription: Exception occurred.err.number is: 80020009err.lastdllerror is: 0err.scriptline is: 274err.source is: Microsoft Outlookerr.helpfile is: err.helpcontext is: 0err.description is: err.windescription: Variable must be of type 'Object'.err.number is: 000000A9err.lastdllerror is: 0err.scriptline is: 285err.source is: err.helpfile is: err.helpcontext is: err.description is: err.windescription: Variable must be of type 'Object'.err.number is: 000000A9err.lastdllerror is: 0err.scriptline is: 286err.source is: err.helpfile is: err.helpcontext is: followed by a crach>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\VM_Shared\AutoIT\QTIP_NOC.au3" /UserParams +>07:11:38 Starting AutoIt3Wrapper v.15.920.938.0 SciTE v.3.6.0.0 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0409)+> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper>Running AU3Check (3.3.14.2) from:C:\Program Files (x86)\AutoIt3 input:C:\VM_Shared\AutoIT\QTIP_NOC.au3+>07:11:39 AU3Check ended.rc:0>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\VM_Shared\AutoIT\QTIP_NOC.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to StopSender = >sender name< Subject = >Subject info<Sender = >sender name< Subject = >Subject info<"C:\VM_Shared\AutoIT\AGC_ONLY.au3" (288) : ==> Subscript used on non-accessible variable.:If $aWidthSender[2] = '' And $aWidthSubject[2] = '' ThenIf $aWidthSender^ ERROR->07:31:15 AutoIt3.exe ended.rc:1+>07:31:15 AutoIt3Wrapper Finished.>Exit code: 1 Time: 1177 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
water Posted December 2, 2015 Author Posted December 2, 2015 Seems that the mail identified by the EntryID no longer exists. The EntryID is changed when the mail gets moved to another folder.You need to add a COM error handler (use function _OL_ErrorNotify) to grab this error and do whatever you need to do when the mail has been moved. 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
nitekram Posted December 2, 2015 Posted December 2, 2015 (edited) @waterI have tried in a few places, to add the function, but now I am not getting any alerts...where would be the best place to call the function, and is it just going to hit on ERRORs? Local $oOL_Item = $oOApp.Session.GetItemFromID($sOL_EntryId, Default) If _OL_ErrorNotify(4) Then ConsoleWrite("ERROR $oOApp.Session.GetItemFromID = " & _OL_ErrorNotify(1)& '<' & @CRLF) Return EndIf EDIT Just tried this, and now am getting alerts again:Local $oOL_Item = $oOApp.Session.GetItemFromID($sOL_EntryId, Default) If _OL_ErrorNotify(4) = @error Then ConsoleWrite("ERROR $oOApp.Session.GetItemFromID = " & _OL_ErrorNotify(1)& '<' & @CRLF) Return EndIf Edited December 2, 2015 by nitekram 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
water Posted December 2, 2015 Author Posted December 2, 2015 (edited) You do not need to query the result of _OL_ErrorNotify.Try something like this:; Insert the following line at the top of your script _OL_ErrorNotify(4) ; That's the part in your event handling function Local $oOL_Item = $oOApp.Session.GetItemFromID($sOL_EntryId, Default) If @error Then ConsoleWrite("ERROR $oOApp.Session.GetItemFromID = " & @error & '<' & @CRLF) Return EndIf Edited December 2, 2015 by water 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
nitekram Posted December 2, 2015 Posted December 2, 2015 Still in the testing phase, but got this error on a crash - !>14:02:22 AutoIt3.exe ended.rc:-805306369 - no error line though 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
water Posted December 3, 2015 Author Posted December 3, 2015 Seems your script gets more and more complex and hence harder to debug.I would prefer a small (just a few lines) reproducer script that shows the same error on my machine so I can play with it. Remote searching for bugs in a huge script is horrible 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
nitekram Posted December 3, 2015 Posted December 3, 2015 (edited) I do not know how short you want it, but here is just the function that I am using, inside of my script. I am going to run it separate to see if I continue to crash.Ok...here is the error then it crashed ERROR $oOApp.Session.GetItemFromID = -2147352567< EDIT -- got this again ERROR $oOApp.Session.GetItemFromID = -2147352567<My code:expandcollapse popup; to run for using NEW EMAIL ALERT - by passing the rule set - will have to create INI file listing the users or subjects for rules #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <ListViewConstants.au3> #include "OutlookEX\OutlookEX 1.0.0.0\OutlookEX.au3" #include "ExtMsgBox.au3" ; file needed for extended functions for MsgBox and StringSize ; Insert the following line at the top of your script _OL_ErrorNotify(4) Global $oOApp = '' If MsgBox(4, 'Outlook Rules', 'You want to run Outlook rule checker?') = 6 Then $oOApp = ObjCreate("Outlook.Application") Global $test = ObjEvent($oOApp, "oOApp_") Else MsgBox(0,'Quitting App', 'The script will now close.') Exit EndIf While 1 ; keep the script alive Sleep(20) WEnd ; Outlook 2007 - NewMailEx event - http://msdn.microsoft.com/en-us/library/bb147646%28v=office.12%29.aspx Func oOApp_NewMailEx($sOL_EntryId) Local $oOL_Item = $oOApp.Session.GetItemFromID($sOL_EntryId, Default) ; That's the part in your event handling function If @error Then ConsoleWrite("ERROR $oOApp.Session.GetItemFromID = " & @error & '<' & @CRLF) Exit EndIf #cs MsgBox(64, "OutlookEX UDF Example Script", "New mail has arrived!" & @CRLF & @CRLF & _ "From: " & $oOL_Item.SenderName & @CRLF & _ "Subject: " & $oOL_Item.Subject) #ce Local $hNewMail = '' $hNewMail = WinActive("[active]", "") ;MsgBox('','', $hNewMail) Sleep(200) If $oOL_Item.SenderName = '' Then MsgBox(0, 'Sender Blank', 'Sender is blank? >' & $oOL_Item.SenderName & '<') Local $aWidthSender = _StringSize($oOL_Item.SenderName) If Not IsArray($aWidthSender) Then MsgBox('','NO ARRAY','$aWidthSender') Return EndIf If $oOL_Item.Subject = '' Then MsgBox(0, 'Subject Blank', 'Subject is blank? >' & $oOL_Item.Subject & '<') Local $aWidthSubject = _StringSize($oOL_Item.Subject) If Not IsArray($aWidthSubject) Then MsgBox('','NO ARRAY','$aWidthSubject') Return EndIf If $aWidthSender[2] = '' And $aWidthSubject[2] = '' Then MsgBox(0,'Blank', 'Either the sender or the subject was blank') Return Else ConsoleWrite("Sender = >" & $oOL_Item.SenderName & '< Subject = >' & $oOL_Item.Subject & '<' & @CRLF) EndIf Local $sbString = StringToBinary($oOL_Item.Subject) Local $sSenderName = $oOL_Item.SenderName Local $sSubject = $oOL_Item.Subject Local $hGUI = GUICreate('New Outlook Email Alert', $aWidthSubject[2] + 400, 200, -1, -1, $WS_SIZEBOX, $WS_EX_TOPMOST) Local $idOK = GUICtrlCreateButton("OK", 110, 160, 85, 25) GUISetState(@SW_SHOW, $hGUI) Local $idListview = GUICtrlCreateListView("From|Subject", 10, 10, $aWidthSubject[2] + 380, 110) GUICtrlSetFont($idListview, Default, Default, Default, "Consolas") ; Monospaced font GUICtrlCreateListViewItem($sSenderName & '|' & $sSubject, $idListview) _GUICtrlListView_SetColumnWidth($idListview, 0, $LVSCW_AUTOSIZE) _GUICtrlListView_SetColumnWidth($idListview, 1, $LVSCW_AUTOSIZE) ; Now resize the GUI and ListView to fit Local $iMaxWidth = 0 For $i = 0 To 1 $iMaxWidth += _GUICtrlListView_GetColumnWidth($idListview, $i) Next WinMove($hGUI, "", Default, Default, $iMaxWidth + 40) ; Just a quick approx - we can refine this ControlMove($hGUI, "", $idListview, 10, 10, $iMaxWidth + 25) Sleep(200) WinActivate($hNewMail) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idOK GUISetState(@SW_HIDE, $hGUI) ExitLoop EndSwitch WEnd EndFunc ;==>oOApp_NewMailEx Here are my two resent crash errors (whole script being used)...one from last night when I came in this morning, and the other after receiving the second of two emails. NOTE, these are coming from my"C:\VM_Shared\AutoIT\AGC_ONLY.au3" (279) : ==> The requested action with this object has failed.:Local $oOL_Item = $oOApp.Session.GetItemFromID($sOL_EntryId, Default)Local $oOL_Item = $oOApp.Session^ ERROR"C:\VM_Shared\AutoIT\AGC_ONLY.au3" (297) : ==> The requested action with this object has failed.:Local $aWidthSender = _StringSize($oOL_Item.SenderName)Local $aWidthSender = _StringSize($oOL_Item^ ERROR Edited December 3, 2015 by nitekram 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
Recommended Posts