david1337 Posted January 26, 2017 Share Posted January 26, 2017 Thank you water Link to comment Share on other sites More sharing options...
water Posted January 26, 2017 Author Share Posted January 26, 2017 When you run _Ol_Open on this machine do you get an error (@error <> 0)? Or do you still get the configuration screen? 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...
david1337 Posted January 26, 2017 Share Posted January 26, 2017 _OL_Open gives no errors, and no configuration screen Link to comment Share on other sites More sharing options...
water Posted January 26, 2017 Author Share Posted January 26, 2017 Then there is at least the default profile - but not fully configured. 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...
david1337 Posted January 26, 2017 Share Posted January 26, 2017 Sorry my bad! _OL_Open gives this error: @error = 9 @extended = 0 Link to comment Share on other sites More sharing options...
water Posted January 26, 2017 Author Share Posted January 26, 2017 So you could open Outlook, check for errors and close Outlook again. 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...
david1337 Posted January 26, 2017 Share Posted January 26, 2017 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 ! Link to comment Share on other sites More sharing options...
david1337 Posted January 26, 2017 Share Posted January 26, 2017 (edited) Okay with even more testing I found out that it's only the _OL_Close function that causes their manual start of Outlook to close :-) I think that my speaking time on this thread is used up the next couple of days! Have a nice weekend Edited January 26, 2017 by david1337 Link to comment Share on other sites More sharing options...
bon3o Posted January 27, 2017 Share Posted January 27, 2017 Hi! I have allmost figured out how to copy messages from one folder to another. But what should i do if there are subfolders? Also please can you explane what does the [0][0] & [1][0] next to $aOL_Item means? Sorry if it is a dumb question, i am not a coder((( Local $sFilePath = "C:\tmp\outlook.log" Local $iFileExists = FileExists($sFilePath) Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) If $iFileExists Then MsgBox($MB_SYSTEMMODAL, "Error, outlook.log exists", "this operation shuold run once" ) Else _FileCreate("c:\tmp\outlook.log") $aOL_Item = _OL_ItemFind($oOutlook, "*\\Входящие", $olMail, "", "", "", "EntryID") While $aOL_Item[0][0] > 0 $aOL_Item = _OL_ItemFind($oOutlook, "*\\Входящие", $olMail, "", "", "", "EntryID") _OL_ItemMove($oOutlook, $aOL_Item[1][0], Default, "*\\Inbox") If @error = 1 Then MsgBox(16, "OutlookEX UDF: _OL_ItemCopy Example Script", "Error copying mail to another folder. @error = " & @error) Wend EndIf _OL_Close($oOutlook) Link to comment Share on other sites More sharing options...
water Posted January 27, 2017 Author Share Posted January 27, 2017 (edited) You need to loop through the array like this: Local $sFilePath = "C:\tmp\outlook.log" Local $iFileExists = FileExists($sFilePath) Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) If $iFileExists Then MsgBox($MB_SYSTEMMODAL, "Error, outlook.log exists", "this operation should run once" ) Else _FileCreate("c:\tmp\outlook.log") $aOL_Item = _OL_ItemFind($oOutlook, "*\\Входящие", $olMail, "", "", "", "EntryID") For $i = 1 to $aOL_Item[0][0] _OL_ItemMove($oOutlook, $aOL_Item[$i][0], Default, "*\\Inbox") If @error Then MsgBox(16, "OutlookEX UDF: _OL_ItemCopy Example Script", "Error copying mail to another folder. @error = " & @error) Next EndIf _OL_Close($oOutlook) $aOL_Item[0][0] holds the number of data rows in the array, $aOL_Item[0][1] the number of columns. Edited January 28, 2017 by water Fixed typo 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 water! Thank you so much! Now the script runs without an error so i can continue to copy next folder items. Link to comment Share on other sites More sharing options...
water Posted January 28, 2017 Author Share Posted January 28, 2017 Glad you like my solution 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 btw, what should i do with the subfolders? is there a way to move like this : "\\inbox1\*" "\\inbox2\" to move all the existing subfolders to inbox2 without moving the parent folder inbox1? Link to comment Share on other sites More sharing options...
water Posted January 28, 2017 Author Share Posted January 28, 2017 Use _OL_FolderTree to get a list of folders in "\\inbox1\*" and then loop through the returned array and use _OL_FolderMove for each entry. 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 (edited) What am i doing wrong? $aFol = _OL_FolderTree($oOutlook, "*\\Входящие\") 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 = 1 to $aFol[0][0] _OL_FolderMove($oOutlook, $aFol[$i][0], "*\\Inbox") If @error Then MsgBox(16, "OutlookEX UDF: _OL_ItemCopy Example Script", "Error copying mail to another folder. @error = " & @error) Next I get an error: Array variable has incorrect number of subscripts or subscript dimension range exceeded.((( Edited January 28, 2017 by bon3o Link to comment Share on other sites More sharing options...
bon3o Posted January 28, 2017 Share Posted January 28, 2017 Why do i get hidden post`s? Link to comment Share on other sites More sharing options...
Developers Jos Posted January 28, 2017 Developers Share Posted January 28, 2017 (edited) 2 minutes ago, bon3o said: Why do i get hidden post`s? There is a check in our forums to avoid spam that does this. Not going to explain too much about it, but don't worry, we will approve them when one of us is around. Jos Edited January 28, 2017 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
water Posted January 28, 2017 Author Share Posted January 28, 2017 _OL_FolderMove moves the folder and all subfolders. So you only need to list the first level of directories using _OL_FolderTree. $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 = 1 to $aFol[0][0] _OL_FolderMove($oOutlook, $aFol[$i][0], "*\\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 Unfortunately i get the same error(( "D:\Desktop\FolderMove.au3" (14) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: For $i = 1 to $aFol[0][0] For $i = 1 to ^ ERROR Link to comment Share on other sites More sharing options...
water Posted January 28, 2017 Author Share Posted January 28, 2017 (edited) _OL_FolderTree returns a 1D array. 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 = 1 to $aFol[0] _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 Edited January 28, 2017 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 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