tczbu 0 Posted December 4, 2020 I have a script that pulls all email from the inbox with a date later than X. It was working great until recently. I'm unable to find the right date format, or code, to make it work. I've also tried pulling all emails without a filter, and that is not working as of recently either. Does anyone know how to properly return emails later than a date? Or, return all emails without a filter? Please help! Thanks! #include <OutlookEX.au3> ;$sFilter = "[CreationTime]>'2020-10-06 00:00'" ;This one doesn't work, gives error. ;$sFilter = "[CreationTime]>'202010060000'" ;This one shows an empty array. ;$sFilter = "[CreationTime]>'20201006000000'" ;This one shows an empty array. ;$sFilter= "[UnRead]=True" ; This one works $sFilter = "" ;This one doesn't work, gives error. Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) $aInboxEmails = _OL_ItemFind($oOutlook, "*\Inbox", $olMail, $sFilter, "", "", "EntryID,SenderEmailAddress,CreationTime,Subject,Body", "") If @error = 0 Then _ArrayDisplay($aInboxEmails, "OutlookEX UDF: _OL_ItemFind") Else MsgBox(16, "OutlookEX UDF: _OL_ItemFind", "Could not find an unread mail. @error = " & @error & ", @extended: " & @extended) EndIf Share this post Link to post Share on other sites
water 2,392 Posted December 4, 2020 (edited) Please have a look at the wiki for the date format needed. You are talking about errors you get. Please provide this error information. Edit: This is true when trying to pull all emails without filter too. Whats the value of @error and @extended after _OL_ItemFind? Please add _OL_ErrorNotify(2) after _OL_Open to grab all COM errors and display detailed error information: Edited December 4, 2020 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
tczbu 0 Posted December 17, 2020 The script started working again. The only thing I can think of that changed is the number of emails in my inbox. I think I had about 1500 emails in my inbox before. I cleaned it up, and now I only have about 750. Is there a limit on the number of emails the _OL_ItemFind function can handle? Thanks for the reply! Share this post Link to post Share on other sites
water 2,392 Posted December 17, 2020 Exactly. There seems to be a limit for the number of items Outlook can open simultaneously as described here. The solution is to drop those properties that keep the item open. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites