bon3o Posted January 28, 2017 Share Posted January 28, 2017 Error gone, but nothing moves from folder to folder((( sorry for being so bothersome Link to comment Share on other sites More sharing options...
water Posted January 28, 2017 Author Share Posted January 28, 2017 My bad. The returned array is zero based, so element 0 doesn't contain a counter but the first folder address. So the script should look like: $aFol = _OL_FolderTree($oOutlook, "*\\Входящие\", 1) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_FolderTree Example Script", "Error accessing folder 'Outlook-UDF-Test'. @error = " & @error) ;_ArrayDisplay($aFol, "OutlookEX UDF: _OL_FolderTree Example Script - Tree starting with '*\Outlook-UDF-Test'") For $i = 0 to UBound($aFol[0]) - 1 _OL_FolderMove($oOutlook, $aFol[$i], "*\\Inbox") If @error Then MsgBox(16, "OutlookEX UDF: _OL_ItemCopy Example Script", "Error copying mail to another folder. @error = " & @error) Next 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 Link to comment Share on other sites More sharing options...
bon3o Posted January 28, 2017 Share Posted January 28, 2017 Still no luck( >Exit code: 0 Time: 0.2894 But nothing moved((( Link to comment Share on other sites More sharing options...
water Posted January 28, 2017 Author Share Posted January 28, 2017 How many entries does _ArrayDisplay show? 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 Link to comment Share on other sites More sharing options...
bon3o Posted January 28, 2017 Share Posted January 28, 2017 in my case: Row|Col 0 [0] |\\example@domain.ru\Входящие [1] |\\example@domain.ru\Входящие\Changesets [2] |\\example@domain.ru\Входящие\test1 [3] |\\example@domain.ru\Входящие\test2 Link to comment Share on other sites More sharing options...
water Posted January 28, 2017 Author Share Posted January 28, 2017 I need a cup of coffee! I hope this works $aFol = _OL_FolderTree($oOutlook, "*\\Входящие\", 1) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_FolderTree Example Script", "Error accessing folder 'Outlook-UDF-Test'. @error = " & @error) ;_ArrayDisplay($aFol, "OutlookEX UDF: _OL_FolderTree Example Script - Tree starting with '*\Outlook-UDF-Test'") For $i = 0 to UBound($aFol) - 1 _OL_FolderMove($oOutlook, $aFol[$i], "*\\Inbox") If @error Then MsgBox(16, "OutlookEX UDF: _OL_ItemCopy Example Script", "Error copying mail to another folder. @error = " & @error) Next 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 Link to comment Share on other sites More sharing options...
bon3o Posted January 28, 2017 Share Posted January 28, 2017 Ahhhr... I have now error code 1 from folderMove((( Seems to be so simple task. But... Link to comment Share on other sites More sharing options...
water Posted January 28, 2017 Author Share Posted January 28, 2017 What is the value of @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 Link to comment Share on other sites More sharing options...
bon3o Posted January 28, 2017 Share Posted January 28, 2017 Sorry? i don`t now how to check this( Link to comment Share on other sites More sharing options...
water Posted January 28, 2017 Author Share Posted January 28, 2017 Modify this line: If @error Then MsgBox(16, "OutlookEX UDF: _OL_ItemCopy Example Script", "Error copying mail to another folder. @error = " & @error & ", @extended = " & @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 Link to comment Share on other sites More sharing options...
bon3o Posted January 28, 2017 Share Posted January 28, 2017 @error = 1, @extended = 1 Link to comment Share on other sites More sharing options...
water Posted January 28, 2017 Author Share Posted January 28, 2017 On 26.01.2017 at 2:03 PM, david1337 said: Yeah, if I can't avoid the crash with _OL_MailSignatureGet error handling in any way, it would have to use _OL_Open. Problem with _OL_Open is that if a user is starting up Outlook manually while _OL_Open is used, then Outlook closes again for that user. I will try to see if I can fix the error handling of _OL_MailSignatureGet somehow. Thanks for your time water ! I think I know why _OL_MailSignatureGet crashes As we do not call _OL_Open there is no COM error handler in place. But all versions of AutoIt after 3.3.12.0 need a COM error handler to grab COM Errors. If there is none the script crashes. As we do not want to call _OL_Open you simply could add _OL_ErrorNotify(4) at the top of your script. david1337 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 Link to comment Share on other sites More sharing options...
water Posted January 28, 2017 Author Share Posted January 28, 2017 I think the double backslash in the target folder is incorrect (can't test at the moment). Could you please try: _OL_FolderMove($oOutlook, $aFol[$i], "*\Inbox") 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 Link to comment Share on other sites More sharing options...
bon3o Posted January 29, 2017 Share Posted January 29, 2017 (edited) The same error((( It looks like the function _OLFolderMove doesn`t gate the value $aFol. So the script gets the wrong value, different from \\example@domain.ru\Входящие\test1. When i write tis value directly to the _OL_FolderMove($oOutlook, "example@domain.ru\Входящие\test1", "*\\Inbox") it moves the folder without any error. Where to dig? How to pass values from the array correctly? The slashes don`t make any difference on the result I tried to go another way. $aFolder = _OL_FolderFind($oOutlook, "*\\Входящие", 99, "", 2, $olMailItem) If @error = 4 Then MsgBox(16, "OutlookEX UDF: _OL_FolderFind Example Script", "Error searching for folder. @error = " & @error & ", @extended = " & @extended) ;_ArrayDisplay($aFolder, "Folders searched by default item type") For $i = 1 to $aFolder[0][0] _OL_FolderMove($oOutlook, $aFolder[$i][1], "*\\Inbox") If @error Then MsgBox(16, "OutlookEX UDF: _OL_ItemCopy Example Script", "Перемещение подпапок из папки Входящие не удалось. @error = " & @error & ", @extended = " & @extended) Next But get the same errors((( 1 and 1 Edited January 29, 2017 by bon3o Link to comment Share on other sites More sharing options...
bon3o Posted January 29, 2017 Share Posted January 29, 2017 (edited) Success!!! The point is that the array from _OL_FolderTree($oOutlook, "*\\Входящие\") consists of folderpaths in "\\folder\folder" But FolderMove exits with error in this case. It doesn`t work with "\\example@domain.ru\folder\folder" because of double slash(\\) All i did is used _ArrayTrim($aFol, 2, 0) cut these two odd symbols. After that the script works perfect! Thank you water for your patience and your help. It was a very usefull expirience for me)))) Below is the code that worked perfect for me: Global $aVhod = _OL_FolderTree($oOutlook, "*\\Входящие\") If @error <> 0 Then Exit MsgBox(16, "Построение дерева папок", "Ошибка при построении дерева папок. @error = " & @error) _ArrayTrim($aVhod, 2, 0) _ArrayDelete($aVhod, '0') For $i = 0 to UBound($aVhod) - 1 _OL_FolderMove($oOutlook, $aVhod[$i], "*\\Inbox") If @error Then MsgBox(16, "OutlookEX UDF: _OL_ItemCopy Example Script", "Перемещение подпапок из папки Входящие не удалось. @error = " & @error & ", @extended = " & @extended) Next Edited January 29, 2017 by bon3o Link to comment Share on other sites More sharing options...
bon3o Posted January 29, 2017 Share Posted January 29, 2017 Now i can`t get how to move items from calendar( How should i search for all items from it? Link to comment Share on other sites More sharing options...
water Posted January 30, 2017 Author Share Posted January 30, 2017 Use _OL_ItemFind to search for $olAppointment items. 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 Link to comment Share on other sites More sharing options...
bon3o Posted January 30, 2017 Share Posted January 30, 2017 Yes, i understand. But it returns an empty result( Link to comment Share on other sites More sharing options...
water Posted January 30, 2017 Author Share Posted January 30, 2017 Can you please post the part of your script where you call _OL_ItemFind? 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 Link to comment Share on other sites More sharing options...
bon3o Posted January 30, 2017 Share Posted January 30, 2017 $aCal = _OL_ItemFind($oOutlook, "*\\Calendar", $olAppointmentItem, "", "", "", "EntryID") _ArrayDisplay($aCal) This is the output: Row|Col 0 [0]|0 Link to comment Share on other sites More sharing options...
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