Skysnake Posted August 31, 2020 Posted August 31, 2020 (edited) 43 minutes ago, water said: You mean the script exits when the your laptop hibernates? No, the script remains "active" when the laptop hibernates. There is no hook to close on hibernate. --> Which may be a very simple solution. It also means Outlook should always be open BEFORE starting the script... Edited August 31, 2020 by Skysnake Skysnake Why is the snake in the sky?
water Posted August 31, 2020 Author Posted August 31, 2020 There is no reason to start Outlook before you start your script. As long as there is an open reference to an Outlook item Outlook does not get closed automatically when started with OL_Open. Details can be found in the MSDN article which is referenced in the wiki article for OutlookEX. 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
caramen Posted September 24, 2020 Posted September 24, 2020 (edited) Erm Hello @water Could you help me a bit plz ? I think I have some difficulties to understand how outlook setup my test environment. For some reason he does not want to make a new profil with "classic" setup. I don't want to manage this, so I'm in the way to make a new script to help my colleagues. But you helped me long time ago about this snippet of code : (I commanted ect to remember later) #include <OutlookEX.au3> #include <Array.au3> ;Connexion outlook. Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_MailheaderGet Example Script", "Error connecting to Outlook. @error = " & @error & ", @extended: " & @extended) ;Connexion InBox Global $aFolder = _OL_FolderAccess($oOutlook, "", $olFolderInbox) $aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, "", "", "", "EntryID,Subject", "", 1) If Not IsArray($aItems) Then Exit MsgBox(48, "", "@error = " & @error & ", @extended: " & @extended) ;Getting last header $LastEntry = UBound ($aItems) $LastEntryLessOne = $LastEntry-1 _ArrayDisplay($LastEntryLessOne) _ArrayDisplay($aItems) $HeaderLastEntry = $aItems[$LastEntryLessOne][1] ;Msging last header MsgBox(0,"",""&$HeaderLastEntry) My "non classic" setup give me troubles : (see screen) for some reasons the new setup make a pst data file into a new account and then adding my gmail account into a second mail box insteed of using the only email as principal. Well no need to try to solve that if you could learn me how to change the readed account. Before asking like always I checked the htm file but I can't rly understand how to do that. This is where I have to work right ? : _OL_FolderAccess Thanks ! EDIT : AutoAnswer : Was playing arround with the function and your error message leaded me on the good way. Solved with : Global $aFolder = _OL_FolderAccess($oOutlook, "USERNAMEOFEMAIL@gmail.com", $olFolderInbox) Edited September 24, 2020 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - 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 - Wiki Tutorials:ADO - Wiki
caramen Posted September 24, 2020 Posted September 24, 2020 (edited) So that make me confused. The old snippet does not work anymore . Or should I say it work but not as I want. The arrays show me I think all my inbox it's ok but I can't see the last email received. Not at first row or last either 3 things : -The last entry is now the last email and not the last received. (Solved) -Also If I want to reduce the return to 50 email maximum this is possible ? -Why the orders of email are no more right ? (Solved) Edited September 24, 2020 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - 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 - Wiki Tutorials:ADO - Wiki
water Posted September 25, 2020 Author Posted September 25, 2020 14 hours ago, caramen said: Also If I want to reduce the return to 50 email maximum this is possible ? Not at the moment. The function returns all records it finds. Why do you want to limit the number of records returned? Performance reasons? caramen 1 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
caramen Posted September 25, 2020 Posted September 25, 2020 (edited) 6 hours ago, water said: Performance reasons Yap The goal is to check the inbox each 2-3 sec to see if there is a new mail, and then do actions depends on the content. And if there is no way to improve the speed it will change all my development previsions. It is actually 15-18 sec to get the 3000 items. I can have 2 3 4 5 6 row from _OL_ItemFind it does not change anything in perf or I don't see it. If the script do action then tag the mail with "folow flag" Or "Color" <- Btw if you can lead me to do that too. (and I tried during 2 hours yesterday I don't did all my test yet, so I will come later If I don't get how to do, I think it's _OL_ItemModify but I didn't check all function yet (consulting Microsoft website is a bit hard for me too because the jargon is not same, object, attribut etc...) ) I take the lead of a new team, and I want to free the guy who is busy on emails to give him better work to do. 😎 If I can't do that in 3 seconds I will need to add a GUI to select a mail from all mails scanned and that will need human control. If I can do that in 3 sec I will just check each 2-3 seconds./ So I can check all emails with that without a human control which is very better for my goal. Edited September 25, 2020 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - 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 - Wiki Tutorials:ADO - Wiki
water Posted September 25, 2020 Author Posted September 25, 2020 Events should be used to act on arriving mails. Please check this thread: caramen 1 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
water Posted September 25, 2020 Author Posted September 25, 2020 Here you find a good desription on how to set the follow up flag. caramen 1 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
caramen Posted September 25, 2020 Posted September 25, 2020 27 minutes ago, water said: Events should be used to act on arriving mails. Please check this thread: Rly interesting, that totally change my vision of what I'm going to do. It is maybe not the place to ask thing like that, I don't want to bother you, you probably busy doing your task as well. Could you give me light on what is the EntryID, I mean in our case we use the EntryID of the mail box, is that right ? Each items got EntryID mean BOX got ID and mails got ID too ? exactly same as active directory SSID ? My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - 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 - Wiki Tutorials:ADO - Wiki
water Posted September 25, 2020 Author Posted September 25, 2020 EntryID is the unique identifier of mail, contacts, folder... items. A store has a unique StoreID. 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
caramen Posted September 25, 2020 Posted September 25, 2020 (edited) 19 minutes ago, water said: Here you find a good desription on how to set the follow up flag. Oh wow wait, there is not any easier way to affect the arrival mails with anything everyone can see without adding VB ?(I think this is to add task) Maybe I gave you wrong info the flag for me is the follow flag this : And after check I could say I'm probably going to use this : With : _OL_CategoryAdd Edited September 25, 2020 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - 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 - Wiki Tutorials:ADO - Wiki
caramen Posted September 26, 2020 Posted September 26, 2020 (edited) 18 hours ago, caramen said: _OL_CategoryAdd I'm whrong I don't get how to simply flag an email. I got the EntryID of the item I want to flag. I don't find any function to do so. Quote $oItem = _OL_ItemModify ($oOutlook, $EntryID, "Default", "Categories=Catégorie Bleu") I think I'm close Edited September 26, 2020 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - 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 - Wiki Tutorials:ADO - Wiki
water Posted September 26, 2020 Author Posted September 26, 2020 Run _OL_CategoryGet to get a list of categories. Then use _OL_ItemModify to set the category as you did in your example. If it doesn't work please post the values of @error and @extended. 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
caramen Posted September 26, 2020 Posted September 26, 2020 (edited) 2 hours ago, water said: Run _OL_CategoryGet to get a list of categories. Then use _OL_ItemModify to set the category as you did in your example. If it doesn't work please post the values of @error and @extended. As you expected. expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.5 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <OutlookEX.au3> #include <Array.au3> Global $aItems ;Connexion outlook. Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_MailheaderGet Example Script", "Error connecting to Outlook. @error = " & @error & ", @extended: " & @extended) ;Connexion InBox Global $aFolder = _OL_FolderAccess($oOutlook, "", $olFolderInbox) _ArrayDisplay($aFolder) ;EntryID , Sender , Body $aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, "" , "", "", "SenderEmailAddress,SenderName,Subject,Body,EntryID,Categories", "[ReceivedTime], True", 1) If Not IsArray($aItems) Then Exit MsgBox(48, "", "@error = " & @error & ", @extended: " & @extended) $EntryID = $aItems[1][4] _ArrayDisplay($aItems) ;Msging the array $HeaderLastReceived = $aItems[1][2] MsgBox(0,"",""&$aItems[1][0]) MsgBox(0,"",""&$aItems[1][1]) MsgBox(0,"",""&$aItems[1][2]) MsgBox(0,"",""&$aItems[1][3]) MsgBox(0,"",""&$aItems[1][4]) $oCatList = _OL_CategoryGet ($oOutlook) _ArrayDisplay($oCatList) $oItem = _OL_ItemModify ($oOutlook, $EntryID, "Default", "Categories=Blue" , "Subject=Test") _OL_Close($oOutlook) _ArrayDisplay($oCatList) : Blue exist And it is POP account. Edited September 26, 2020 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - 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 - Wiki Tutorials:ADO - Wiki
water Posted September 26, 2020 Author Posted September 26, 2020 $oItem = _OL_ItemModify ($oOutlook, $EntryID, "Default", "Categories=Blue" , "Subject=Test") needs to be $oItem = _OL_ItemModify ($oOutlook, $EntryID, Default, "Categories=Blue" , "Subject=Test") What is the value of @error and @extended after you call _OL_ItemModify? caramen 1 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
caramen Posted September 26, 2020 Posted September 26, 2020 it work without brackets thanks bro My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - 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 - Wiki Tutorials:ADO - Wiki
caramen Posted September 27, 2020 Posted September 27, 2020 (edited) nvm Edited September 27, 2020 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - 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 - Wiki Tutorials:ADO - Wiki
caramen Posted October 1, 2020 Posted October 1, 2020 (edited) Hello @water It's me again 😕 I'm getting stuck. I'm trying to understand how to move an item. I'm confused between : Store and Folder for example, actually I'm trying to do an array display of SubFolder1 item(s) This doesn't work and I know this is my fault : What I do wrong please ? $oBoite = "******@hotmail.com" $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur de connection à Outlook. @error = " & @error & ", @extended: " & @extended) $tFolder = _OL_FolderTree($oOutlook, "*") If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_FolderTree Example Script", "Error accessing root folder. @error = " & @error) ;~ $aFolder = _OL_FolderAccess($oOutlook, $oBoite, "SubFolder1" ) ;~ $aFolder = _OL_FolderAccess($oOutlook, $oBoite, $olFolderInbox) $aFolder = _OL_FolderAccess($oOutlook, $oBoite, $tFolder[3] ) If Not IsArray($aFolder) Then MsgBox (0,0,"pas d'accès" & @CRLF & "@error = " & @error & ", @extended: " & @extended) $aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, "" , "", "", "SenderEmailAddress,SenderName,Subject,Body,EntryID,Categories", "[ReceivedTime], True", 0 ) If Not IsArray($aItems) Then MsgBox(48, "", "Pas de mail trouvé" & @CRLF & "@error = " & @error & ", @extended: " & @extended) _ArrayDisplay($tFolder) _ArrayDisplay ($aFolder) _ArrayDisplay ($aItems) My second question is : $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur de connection à Outlook. @error = " & @error & ", @extended: " & @extended) $aFolder = _OL_FolderAccess($oOutlook, $oBoite, $olFolderInbox) If Not IsArray($aFolder) Then MsgBox (0,0,"pas d'accès" & @CRLF & "@error = " & @error & ", @extended: " & @extended) $aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, "" , "", "", "SenderEmailAddress,SenderName,Subject,Body,EntryID,Categories", "[ReceivedTime], True", 1 ) If Not IsArray($aItems) Then MsgBox(48, "", "Pas de mail trouvé" & @CRLF & "@error = " & @error & ", @extended: " & @extended) _ArrayDisplay ($aFolder) _ArrayDisplay ($aItems) This sample work nice. But If I change the last parameter of _OL_ItemFind to 0 regarding your documentation I should do same without subfolder in my matches. But nop, if I do so, My Arrays is empty But my inbox contain 1800 items. Well while I'm writing this I realize my inbox is probably a folder so ? If I solve my first problem I will solve this one does I'm right ? Edited October 1, 2020 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - 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 - Wiki Tutorials:ADO - Wiki
water Posted October 1, 2020 Author Posted October 1, 2020 In short: A Store is the parent object of folders like mail, calendar etc. A store can reside on Exchange, in a local PST file or it can connect to a gmail account. When you check the parameters for _OL_FolderAccess you will see that it doesn't ask for a store. The store is the first part of the folderaddress e.g. "Boîte the réception\SubFolder1". To make sure you grab any errors and know which error occurred please check the value o @error and @extended after calling a _OL_* function or add _OL_ErrorNotify(2) at the top of your script ater _OL_Open to get detailed error description. 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
caramen Posted October 2, 2020 Posted October 2, 2020 (edited) Ok @water So I made this reproducer : expandcollapse popup_OL_ErrorNotify(2) Global $oBoite = "" ;~ $oBoite = "*********@hotmail.com" $oBoite = "Contact@web-********.com" Global $oItem , $oOutlook , $aFolder , $oStoreID , $aItems , $EntryID Global $nMsg , $cHeight , $iRow , $aResult , $aFolder2 , $aItems2 $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur de connection à Outlook. @error = " & @error & ", @extended: " & @extended) $aFolder = _OL_FolderAccess($oOutlook, $oBoite, $olFolderInbox) If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur de connection aux dossiers Outlook. @error = " & @error & ", @extended: " & @extended) _ArrayDisplay ($aFolder , "$aFolder") $aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, "" , "", "", "SenderEmailAddress,SenderName,Subject,Body,EntryID,Categories", "[ReceivedTime], True", 1 ) If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur de connection aux items Outlook $aItems. @error = " & @error & ", @extended: " & @extended) _ArrayDisplay ($aItems, "$aItems") $aResult = _OL_FolderTree($oOutlook, $aFolder[1] ) If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur d'arbo. @error = " & @error & ", @extended: " & @extended) _ArrayDisplay ($aResult, "$aResult") $aFolder2 = _OL_FolderFind( $oOutlook , $aFolder[1] , 99 , "Test12345" ) If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur Dossier introuvable folderfind. @error = " & @error & ", @extended: " & @extended) _ArrayDisplay ( $aFolder2, "$aFolder2") Global $DEBUG2 = MsgBox(0,0,"DEBUG2 :" & $aFolder2[1][0] ) Global $DEBUG3 = MsgBox(0,0,"DEBUG3 :" & $aFolder2[1][1] ) Global $DEBUG4 = MsgBox(0,0,"DEBUG4 :" & $aFolder2[1][2] ) $aItems2 = _OL_ItemFind($oOutlook, $aFolder2[1][2], $olMail, "" , "", "", "SenderEmailAddress,SenderName,Subject,Body,EntryID,Categories", "[ReceivedTime], True", 1 ) If @error <> 0 Then Exit MsgBox(16, "Outlook", "Erreur de connection aux items Outlook $aItems2. @error = " & @error & ", @extended: " & @extended) _ArrayDisplay ($aItems2, "$aItems2") First unexpected use of return : --- $aItems = _OL_ItemFind = "" <- The row 1 of $aFolder is empty ? (I would have expect to use $aFolder[3] to have the right return in $aItems but nop it only work as expected with $aFolder[1])3 - StoreID (string) of the store to access the folder by ID second unexpected return : --- $aResult use the same variable of _OL_ItemFind which is returning contact@************ But still $aResult return to me the results of hotmail account. Corrected. Reproducer Edited Now I thought I was OK but no : $DEBUG4 = Test12345 $aItems2 = @Error : Edited October 2, 2020 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - 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 - Wiki Tutorials:ADO - 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