water Posted February 23, 2021 Share Posted February 23, 2021 Let's do the most basic checks. I hope we can see what goes wrong: #include <OutlookEX.au3> Global $oOL = _OL_Open() _OL_ErrorNotify(1) ; Check recipient Global $aRecipient = _OL_ItemRecipientCheck($oOL, "g-cut") If @error Then MsgBox(0, "Test", "Error checking recipient! @error=" & @error & ", @extended=" & @extended) Else _ArrayDisplay($aRecipient, "Recipient") EndIf ; First try to access folder Global $aFolder = _OL_FolderAccess($oOL, "\\g-cut", $olFolderInbox) If @error Then MsgBox(0, "Test", "Error first folderaccess! @error=" & @error & ", @extended=" & @extended) Else _ArrayDisplay($aFolder, "First folderaccess") EndIf ; Second try to access folder Global $aFolder = _OL_FolderAccess($oOL, "\\g-cut\Posteingang") If @error Then MsgBox(0, "Test", "Error second folderaccess! @error=" & @error & ", @extended=" & @extended) Else _ArrayDisplay($aFolder, "Second folderaccess") EndIf 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...
rudi Posted February 25, 2021 Author Share Posted February 25, 2021 (edited) Hello @water thanks for your reply. expandcollapse popup#include <OutlookEX.au3> Global $oOL = _OL_Open() _OL_ErrorNotify(1) ; Check recipient Global $aRecipient = _OL_ItemRecipientCheck($oOL, "g-cut") If @error Then MsgBox(0, "Test", "Error checking recipient! @error=" & @error & ", @extended=" & @extended) Else _ArrayDisplay($aRecipient, "Recipient") for $i = 0 to UBound($aRecipient,2) - 1 ConsoleWrite("$i = " & $i & @TAB & "'" & $aRecipient[1][$i] &"'" & @CRLF) Next EndIf ; First try to access folder Global $aFolder = _OL_FolderAccess($oOL, "\\g-cut", $olFolderInbox) $err=@error $ext=@extended If @error Then MsgBox(0, "Test", "Error first folderaccess! @error=" & $err & ", @extended=" & $ext) ConsoleWrite( "Error first folderaccess! @error=" & $err & ", @extended=" & $ext & @CRLF ) Else _ArrayDisplay($aFolder, "First folderaccess") EndIf ; Second try to access folder Global $aFolder = _OL_FolderAccess($oOL, "\\g-cut\Posteingang") $err=@error $ext=@extended If @error Then MsgBox(0, "Test", "Error second folderaccess! @error=" & $err & ", @extended=" & $ext) ConsoleWrite("Error second folderaccess! @error=" & $err & ", @extended=" & $ext & @CRLF ) Else _ArrayDisplay($aFolder, "Second folderaccess") EndIf Output: expandcollapse popup>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\temp\g-cut-monitoring.au3" /UserParams +>13:11:54 Starting AutoIt3Wrapper v.18.708.1148.0 SciTE v.4.1.0.0 Keyboard:00000407 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0407) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\admin.AD\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\admin.AD\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:C:\temp\g-cut-monitoring.au3 +>13:11:54 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\temp\g-cut-monitoring.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop $i = 0 'g-cut' $i = 1 'True' $i = 2 '' $i = 3 '' $i = 4 'g-cut@company.de' ; company replaced ... ;-) $i = 5 '0' $i = 6 'Sammelpostfach G-Cut' COM Error Encountered in g-cut-monitoring.au3 UDF version = OutlookEX_Base: 1.2.3.0 2020-12-10 OutlookEX: 1.6.3.1 2020-12-15 @AutoItVersion = 3.3.14.5 @AutoItX64 = 0 @Compiled = 0 @OSArch = X64 @OSVersion = WIN_10 Scriptline = 945 NumberHex = 0x80020009 Number = -2147352567 WinDescription = Ausnahmefehler aufgetreten. Description = Ein Clientvorgang ist fehlgeschlagen. Source = Microsoft Outlook HelpFile = HelpContext = 0 LastDllError = 0 ======================================================== Error first folderaccess! @error=3, @extended=-2147352567 Error second folderaccess! @error=1, @extended=0 +>13:12:01 AutoIt3.exe ended.rc:0 +>13:12:01 AutoIt3Wrapper Finished. >Exit code: 0 Time: 7.563 <edit> outlook.exe was running while executing the script </edit> Edited February 25, 2021 by rudi Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
water Posted February 25, 2021 Share Posted February 25, 2021 Could you please try: Global $aFolder = _OL_FolderAccess($oOL, "\\Sammelpostfach G-Cut\", $olFolderInbox) or Global $aFolder = _OL_FolderAccess($oOL, "\\G-Cut\", $olFolderInbox) 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...
rudi Posted February 25, 2021 Author Share Posted February 25, 2021 expandcollapse popup#include <OutlookEX.au3> Global $oOL = _OL_Open() _OL_ErrorNotify(1) ; Check recipient Global $aRecipient = _OL_ItemRecipientCheck($oOL, "g-cut") If @error Then MsgBox(0, "Test", "Error checking recipient! @error=" & @error & ", @extended=" & @extended) Else _ArrayDisplay($aRecipient, "Recipient") for $i = 0 to UBound($aRecipient,2) - 1 ConsoleWrite("$i = " & $i & @TAB & "'" & $aRecipient[1][$i] &"'" & @CRLF) Next EndIf #cs ; First try to access folder Global $aFolder = _OL_FolderAccess($oOL, "\\g-cut", $olFolderInbox) $err=@error $ext=@extended If @error Then MsgBox(0, "Test", "Error first folderaccess! @error=" & $err & ", @extended=" & $ext) ConsoleWrite( "Error first folderaccess! @error=" & $err & ", @extended=" & $ext & @CRLF ) Else _ArrayDisplay($aFolder, "First folderaccess") EndIf ; Second try to access folder Global $aFolder = _OL_FolderAccess($oOL, "\\g-cut\Posteingang") $err=@error $ext=@extended If @error Then MsgBox(0, "Test", "Error second folderaccess! @error=" & $err & ", @extended=" & $ext) ConsoleWrite("Error second folderaccess! @error=" & $err & ", @extended=" & $ext & @CRLF ) Else _ArrayDisplay($aFolder, "Second folderaccess") EndIf #ce ; 3rd try to access folder Global $aFolder = _OL_FolderAccess($oOL, "\\Sammelpostfach g-cut\Posteingang") $err=@error $ext=@extended If @error Then MsgBox(0, "Test 3", "Error 3rd folderaccess! @error=" & $err & ", @extended=" & $ext) ConsoleWrite("Error second folderaccess! @error=" & $err & ", @extended=" & $ext & @CRLF ) Else _ArrayDisplay($aFolder, "folderaccess Test 3") EndIf ; 4th try to access folder Global $aFolder = _OL_FolderAccess($oOL, "\\g-cut\", $olFolderInbox) $err=@error $ext=@extended If @error Then MsgBox(0, "Test 4", "Error 4th folderaccess! @error=" & $err & ", @extended=" & $ext) ConsoleWrite( "Error first folderaccess! @error=" & $err & ", @extended=" & $ext & @CRLF ) Else _ArrayDisplay($aFolder, "folderaccess Test 4") ConsoleWrite("4th folder access:" & @CRLF) for $i = 0 to UBound($aFolder) - 1 ConsoleWrite("$i = " & $i & @TAB & "'" & $aFolder[$i] &"'" & @CRLF) Next EndIf ; 5th try to access folder Global $aFolder = _OL_FolderAccess($oOL, "\\Sammelpostfach g-cut\",$olFolderInbox) $err=@error $ext=@extended If @error Then MsgBox(0, "Test 5", "Error 5th folderaccess! @error=" & $err & ", @extended=" & $ext) ConsoleWrite("Error second folderaccess! @error=" & $err & ", @extended=" & $ext & @CRLF ) Else _ArrayDisplay($aFolder, "folderaccess Test 5") ConsoleWrite("5th folder access:" & @CRLF) for $i = 0 to UBound($aFolder) - 1 ConsoleWrite("$i = " & $i & @TAB & "'" & $aFolder[$i] &"'" & @CRLF) Next EndIf expandcollapse popup>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\temp\g-cut-monitoring.au3" /UserParams +>17:30:58 Starting AutoIt3Wrapper v.18.708.1148.0 SciTE v.4.1.0.0 Keyboard:00000407 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0407) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\admin.AD\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\admin.AD\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:C:\temp\g-cut-monitoring.au3 +>17:30:58 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\temp\g-cut-monitoring.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop $i = 0 'g-cut' $i = 1 'True' $i = 2 '' $i = 3 '' $i = 4 'g-cut@company.de' $i = 5 '0' $i = 6 'Sammelpostfach G-Cut' Error second folderaccess! @error=1, @extended=0 COM Error Encountered in g-cut-monitoring.au3 UDF version = OutlookEX_Base: 1.2.3.0 2020-12-10 OutlookEX: 1.6.3.1 2020-12-15 @AutoItVersion = 3.3.14.5 @AutoItX64 = 0 @Compiled = 0 @OSArch = X64 @OSVersion = WIN_10 Scriptline = 968 NumberHex = 0x80020009 Number = -2147352567 WinDescription = Ausnahmefehler aufgetreten. Description = Der versuchte Vorgang konnte nicht ausgeführt werden. Ein Objekt wurde nicht gefunden. Source = Microsoft Outlook HelpFile = HelpContext = 0 LastDllError = 0 ======================================================== 4th folder access: $i = 0 '5' $i = 1 '' $i = 2 '0' $i = 3 '0000000038A1BB1005E5101AA1BB08002B2A56C20000454D534D44422E444C4C00000000000000001B55FA20AA6611CD9BC800AA002FC45A0C000000672D63757440676F6570666572742E6465002F6F3D476F6570666572742F6F753D45786368616E67652041646D696E6973747261746976652047726F7570202846594449424F484632335350444C54292F636E3D526563697069656E74732F636E3D65633865386163376539303534633532383832383162333935326564303031392D53616D6D656C706F73746661636800E94632F436000000020000001000000067002D00630075007400400067006F006500700066006500720074002E006400650000000000' $i = 4 '00000000507DDCA1132F3548913BD0B33502071F010008895341DEC4354C8368E0C953068A5B00000000010C0000' $i = 5 '' COM Error Encountered in g-cut-monitoring.au3 UDF version = OutlookEX_Base: 1.2.3.0 2020-12-10 OutlookEX: 1.6.3.1 2020-12-15 @AutoItVersion = 3.3.14.5 @AutoItX64 = 0 @Compiled = 0 @OSArch = X64 @OSVersion = WIN_10 Scriptline = 968 NumberHex = 0x80020009 Number = -2147352567 WinDescription = Ausnahmefehler aufgetreten. Description = Der versuchte Vorgang konnte nicht ausgeführt werden. Ein Objekt wurde nicht gefunden. Source = Microsoft Outlook HelpFile = HelpContext = 0 LastDllError = 0 ======================================================== 5th folder access: $i = 0 '5' $i = 1 '' $i = 2 '0' $i = 3 '0000000038A1BB1005E5101AA1BB08002B2A56C20000454D534D44422E444C4C00000000000000001B55FA20AA6611CD9BC800AA002FC45A0C000000672D63757440676F6570666572742E6465002F6F3D476F6570666572742F6F753D45786368616E67652041646D696E6973747261746976652047726F7570202846594449424F484632335350444C54292F636E3D526563697069656E74732F636E3D65633865386163376539303534633532383832383162333935326564303031392D53616D6D656C706F73746661636800E94632F436000000020000001000000067002D00630075007400400067006F006500700066006500720074002E006400650000000000' $i = 4 '00000000507DDCA1132F3548913BD0B33502071F010008895341DEC4354C8368E0C953068A5B00000000010C0000' $i = 5 '' +>17:31:46 AutoIt3.exe ended.rc:0 +>17:31:46 AutoIt3Wrapper Finished. >Exit code: 0 Time: 47.99 in the next posting I'll show what I get when I try to go further on from these results right now. Separate posting to not mix up the two differnt steps. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
rudi Posted February 25, 2021 Author Share Posted February 25, 2021 expandcollapse popup#include <OutlookEX.au3> ; ***************************************************************************** ; Create test environment ; ***************************************************************************** Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) MsgBox(0, '', VarGetType($oOutlook)) Enum $iCount,$iObj,$iType,$iStoreID,$iEntryID,$iFPath $MailboxInbox='\\g-cut\' ; ' comment just to catch away the escaped '' for accurate displaying here in the forum Global $aFolder = _OL_FolderAccess($oOutlook, $MailboxInbox,$olFolderInbox) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_FolderAccess Example 1", "Error accessing inbox of '" & $MailboxInbox & "'" & @CRLF & _ "@error = " & @error & @CRLF & _ "@extended = " & @extended) Global $aFolderDisplay[6][3] = [[$aFolder[0]],["","Folder object"],["","Default item type for the folder"],["", "StoreID where the folder resides"],["", "EntryID of the folder"],["", "Folder path"]] $aFolderDisplay[1][0] = $aFolder[1] $aFolderDisplay[1][2] = VarGetType($aFolder[1]) $aFolderDisplay[2][0] = $aFolder[2] $aFolderDisplay[2][2] = VarGetType($aFolder[2]) $aFolderDisplay[3][0] = $aFolder[3] $aFolderDisplay[3][2] = VarGetType($aFolder[3]) $aFolderDisplay[4][0] = $aFolder[4] $aFolderDisplay[4][2] = VarGetType($aFolder[4]) $aFolderDisplay[5][0] = $aFolder[5] $aFolderDisplay[5][2] = VarGetType($aFolder[5]) _ArrayDisplay($aFolderDisplay, "Folder 'inbox' of '" & $MailboxInbox & "' successfully accessed.") $aContentInfo=_OL_FolderGet($oOutlook,$aFolder[$iObj]) _ArrayDisplay($aContentInfo, "7=unread, 8=total") >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\temp\g-cut-monitoring-old.au3" /UserParams +>17:44:00 Starting AutoIt3Wrapper v.18.708.1148.0 SciTE v.4.1.0.0 Keyboard:00000407 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0407) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\admin.AD\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\admin.AD\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:C:\temp\g-cut-monitoring-old.au3 +>17:44:01 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\temp\g-cut-monitoring-old.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop "C:\Program Files (x86)\AutoIt3\Include\OutlookEX.au3" (1455) : ==> The requested action with this object has failed.: If $oAccount.DeliveryStore.StoreID = $oFolderStore.StoreID Then If $oAccount.DeliveryStore.StoreID = $oFolderStore^ ERROR ->17:44:44 AutoIt3.exe ended.rc:1 +>17:44:44 AutoIt3Wrapper Finished. >Exit code: 1 Time: 44.11 Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
water Posted February 27, 2021 Share Posted February 27, 2021 I interpret this post that test 5 works without error. In your next post you use test 4 and get an error. But this error is caused by $aContentInfo=_OL_FolderGet($oOutlook,$aFolder[$iObj]) and $iObj being undefined. So it seems test 4 and test 5 work. Problem solved? 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...
rudi Posted March 1, 2021 Author Share Posted March 1, 2021 No, $iObj is *NOT* undefined, I enum'ed it to make it more clearly for myself what array position is holding what information: Enum $iCount,$iObj,$iType,$iStoreID,$iEntryID,$iFPath In my last post it's visible, that "folderpath" = [5] is empty and of VarType = "KeyWord" (???) I guess, that the mailbox "is-addressed-correctly", ([$iStoreID] and [$iEntryID] are populated), but not the mailbox's "sub-element-inbox", maybe due to the fact that -- as you stated above already -- $olFolderInbox isn't working properly for non English Outlook localizations, and the "Name" of the folder is not "inbox", but "Posteingang" for German localization. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
water Posted March 1, 2021 Share Posted March 1, 2021 (edited) Could you please run your script with $MailboxInbox='\\g-cut\\' Edit: $olFolderInbox is the language independant way to access a folder. If this doesn't work then we are in trouble Edited March 1, 2021 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...
rudi Posted March 5, 2021 Author Share Posted March 5, 2021 expandcollapse popup#include <OutlookEX.au3> ; ***************************************************************************** ; Create test environment ; ***************************************************************************** Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) MsgBox(0, '', VarGetType($oOutlook)) Enum $iCount,$iObj,$iType,$iStoreID,$iEntryID,$iFPath $MailboxInbox='\\g-cut\\' Global $aFolder = _OL_FolderAccess($oOutlook, $MailboxInbox,$olFolderInbox) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_FolderAccess Example 1", "Error accessing inbox of '" & $MailboxInbox & "'" & @CRLF & _ "@error = " & @error & @CRLF & _ "@extended = " & @extended) Global $aFolderDisplay[6][3] = [[$aFolder[0]],["","Folder object"],["","Default item type for the folder"],["", "StoreID where the folder resides"],["", "EntryID of the folder"],["", "Folder path"]] $aFolderDisplay[1][0] = $aFolder[1] $aFolderDisplay[1][2] = VarGetType($aFolder[1]) $aFolderDisplay[2][0] = $aFolder[2] $aFolderDisplay[2][2] = VarGetType($aFolder[2]) $aFolderDisplay[3][0] = $aFolder[3] $aFolderDisplay[3][2] = VarGetType($aFolder[3]) $aFolderDisplay[4][0] = $aFolder[4] $aFolderDisplay[4][2] = VarGetType($aFolder[4]) $aFolderDisplay[5][0] = $aFolder[5] $aFolderDisplay[5][2] = VarGetType($aFolder[5]) _ArrayDisplay($aFolderDisplay, "Folder 'inbox' of '" & $MailboxInbox & "' successfully accessed.") $aContentInfo=_OL_FolderGet($oOutlook,$aFolder[$iObj]) _ArrayDisplay($aContentInfo, "7=unread, 8=total") >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\temp\g-cut-DoubleBackslash-head-and-tail.au3" /UserParams +>10:45:00 Starting AutoIt3Wrapper v.18.708.1148.0 SciTE v.4.1.0.0 Keyboard:00000407 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0407) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\Rudi\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\Rudi\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:C:\temp\g-cut-DoubleBackslash-head-and-tail.au3 +>10:45:00 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\temp\g-cut-DoubleBackslash-head-and-tail.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop "C:\Program Files (x86)\AutoIt3\Include\OutlookEX.au3" (1455) : ==> The requested action with this object has failed.: If $oAccount.DeliveryStore.StoreID = $oFolderStore.StoreID Then If $oAccount.DeliveryStore.StoreID = $oFolderStore^ ERROR ->10:47:02 AutoIt3.exe ended.rc:1 +>10:47:02 AutoIt3Wrapper Finished. >Exit code: 1 Time: 122.9 The folderpath is empty, the array element, that should hold it is of VarType = "Keyword" ??? Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
water Posted March 5, 2021 Share Posted March 5, 2021 (edited) Can you please test which kind of keyword we have? If IsKeyword($aFolder[5]) = $KEYWORD_DEFAULT Then ConsoleWrite("FolderPath is set to Default" & @CRLF) If IsKeyword($aFolder[5]) = $KEYWORD_NULL Then ConsoleWrite("FolderPath is set to Null" & @CRLF) And can you please do another test with #RequireAdmin at the top of your script? Edited March 5, 2021 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...
rudi Posted March 8, 2021 Author Share Posted March 8, 2021 Result: FolderPath is set to Null script: #include <OutlookEX.au3> Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) MsgBox(0, '', VarGetType($oOutlook)) Enum $iCount,$iObj,$iType,$iStoreID,$iEntryID,$iFPath $MailboxInbox='\\g-cut\\' Global $aFolder = _OL_FolderAccess($oOutlook, $MailboxInbox,$olFolderInbox) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_FolderAccess Example 1", "Error accessing inbox of '" & $MailboxInbox & "'" & @CRLF & _ "@error = " & @error & @CRLF & _ "@extended = " & @extended) If IsKeyword($aFolder[$iFPath]) = $KEYWORD_DEFAULT Then ConsoleWrite("FolderPath is set to Default" & @CRLF) If IsKeyword($aFolder[$iFPath]) = $KEYWORD_NULL Then ConsoleWrite("FolderPath is set to Null" & @CRLF) $aContentInfo=_OL_FolderGet($oOutlook,$aFolder[$iObj]) _ArrayDisplay($aContentInfo, "7=unread, 8=total") full output: >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\temp\g-cut-DoubleBackslash-KeywordCheck.au3" /UserParams +>11:55:37 Starting AutoIt3Wrapper v.18.708.1148.0 SciTE v.4.1.0.0 Keyboard:00000407 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0407) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\admin.AD\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\admin.AD\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:C:\temp\g-cut-DoubleBackslash-KeywordCheck.au3 +>11:55:37 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\temp\g-cut-DoubleBackslash-KeywordCheck.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop FolderPath is set to Null "C:\Program Files (x86)\AutoIt3\Include\OutlookEX.au3" (1455) : ==> The requested action with this object has failed.: If $oAccount.DeliveryStore.StoreID = $oFolderStore.StoreID Then If $oAccount.DeliveryStore.StoreID = $oFolderStore^ ERROR ->11:55:39 AutoIt3.exe ended.rc:1 +>11:55:39 AutoIt3Wrapper Finished. >Exit code: 1 Time: 2.935 Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
water Posted March 9, 2021 Share Posted March 9, 2021 Very, very strange 😣 If I find some spare time I will have to create a debugging function. So we know _OL_FolderAccess really does! Stay tuned 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...
rudi Posted March 10, 2021 Author Share Posted March 10, 2021 Thanks a lot for all your help -- I appreciate that really very much! Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
water Posted March 13, 2021 Share Posted March 13, 2021 Could you please run the following script? Then post the content of the SciTE output pane. Please do not add or insert any lines. Makes debugging easier for me If needed modify line 5: Global $sMailbox = "\\g-cut\\" expandcollapse popup#include <OutlookEX.au3> Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) Global $sMailbox = "\\g-cut\\" Global $aFolder = _OL_FolderAccessEX($oOutlook, $sMailbox, $olFolderInbox) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_FolderAccess Example Script", "Error accessing folder. @error = " & @error) Global $aFolderDisplay[6][3] = [[$aFolder[0], 3], ["Folder object"], ["Default item type for the folder"], ["StoreID where the folder resides"], ["EntryID of the folder"], ["Folder path"]] $aFolderDisplay[1][1] = $aFolder[1] $aFolderDisplay[2][1] = $aFolder[2] $aFolderDisplay[3][1] = $aFolder[3] $aFolderDisplay[4][1] = $aFolder[4] $aFolderDisplay[5][1] = $aFolder[5] $aFolderDisplay[1][2] = VarGetType($aFolder[1]) $aFolderDisplay[2][2] = VarGetType($aFolder[2]) $aFolderDisplay[3][2] = VarGetType($aFolder[3]) $aFolderDisplay[4][2] = VarGetType($aFolder[4]) $aFolderDisplay[5][2] = VarGetType($aFolder[5]) _ArrayDisplay($aFolderDisplay) _OL_Close($oOutlook) Func _OL_FolderAccessEX($oOL, $sFolder = "", $iFolderType = Default, $iItemType = Default) If $sFolder = Default Then $sFolder = "" Local $oFolder, $aFolders, $aResult[6] = [5] ; Set $iFolderType based on $iItemType If $sFolder = "" And $iFolderType = Default Then If $iItemType = Default Then Return SetError(5, 0, "") Local $aFolders[8][2] = [[7, 2], [$olAppointmentItem, $olFolderCalendar], [$olContactItem, $olFolderContacts], [$olDistributionListItem, $olFolderContacts], _ [$olJournalItem, $olFolderJournal], [$olMailItem, $olFolderDrafts], [$olNoteItem, $olFolderNotes], [$olTaskItem, $olFolderTasks]] Local $bFound = False For $iIndex = 1 To $aFolders[0][0] If $iItemType = $aFolders[$iIndex][0] Then $iFolderType = $aFolders[$iIndex][1] $bFound = True ExitLoop EndIf Next If $bFound = False Then SetError(6, 0, "") EndIf Local $oNamespace = $oOL.GetNamespace("MAPI") If $sFolder = "" Or (StringLeft($sFolder, 1) = "\" And _ ; No folder specified. Use default folder depending on $iFolderType StringMid($sFolder, 2, 1) <> "\") Then ; Folder starts with "\" = subfolder in default folder depending on $iFolderType ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sFolder = ' & $sFolder & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console If $iFolderType = Default Or Not IsNumber($iFolderType) Then Return SetError(1, 0, "") ; Required $iFolderType is missing ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iFolderType = ' & $iFolderType & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $oFolder = $oNamespace.GetDefaultFolder($iFolderType) If @error Or Not IsObj($oFolder) Then Return SetError(3, @error, "") If $sFolder <> "" Then $aFolders = StringSplit(StringMid($sFolder, 2), "\") SetError(0) ; Reset @error possibly set by StringSplit For $iIndex = 1 To $aFolders[0] $oFolder = $oFolder.Folders($aFolders[$iIndex]) If @error Or Not IsObj($oFolder) Then Return SetError(4, $iIndex, "") Next EndIf Else If StringLeft($sFolder, 2) = "\\" Then ; Access a folder of another user ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sFolder = ' & $sFolder & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console If $iFolderType = Default Or Not IsNumber($iFolderType) Then Return SetError(1, 0, "") ; Required $iFolderType is missing $aFolders = StringSplit(StringMid($sFolder, 3), "\") ; Split off Recipient SetError(0) ; Reset @error possibly set by StringSplit If $aFolders[1] = "*" Then $aFolders[1] = $oNamespace.CurrentUser.Name ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $aFolders[1] = ' & $aFolders[1] & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Local $oDummy = $oNamespace.CreateRecipient("=" & $aFolders[1]) ; Create Recipient. "=" sets resolve to strict $oDummy.Resolve ; Resolve If Not $oDummy.Resolved Then Return SetError(2, 0, "") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $aFolders[0] = ' & $aFolders[0] & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console If $aFolders[0] > 1 And StringStripWS($aFolders[2], BitOR($STR_STRIPLEADING, $STR_STRIPTRAILING)) = "" Then ; Access a subfolder of the specified default folder of another user (\\firstname lastname\\defaultFolder) $oFolder = $oNamespace.GetSharedDefaultFolder($oDummy, $iFolderType) If @error Or Not IsObj($oFolder) Then Return SetError(3, @error, "") Else ; Access any folder of another user (\\firstname lastname\defaultFolder) $oFolder = $oNamespace.GetSharedDefaultFolder($oDummy, $iFolderType).Parent If @error Or Not IsObj($oFolder) Then Return SetError(3, @error, "") EndIf Else ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sFolder = ' & $sFolder & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $aFolders = StringSplit($sFolder, "\") ; Folder specified. Split and get the object SetError(0) ; Reset @error possibly set by StringSplit If $aFolders[1] = "*" Then $aFolders[1] = $oNamespace.GetDefaultFolder($olFolderInbox).Parent.Name ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $aFolders[1] = ' & $aFolders[1] & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $oFolder = $oNamespace.Folders($aFolders[1]) If @error Or Not IsObj($oFolder) Then Return SetError(4, 1, "") EndIf If $aFolders[0] > 1 Then ; Access subfolders For $iIndex = 2 To $aFolders[0] If $aFolders[$iIndex] <> "" Then $oFolder = $oFolder.Folders($aFolders[$iIndex]) If @error Or Not IsObj($oFolder) Then Return SetError(4, $iIndex, "") EndIf Next EndIf EndIf $aResult[1] = $oFolder $aResult[2] = $oFolder.DefaultItemType $aResult[3] = $oFolder.StoreID $aResult[4] = $oFolder.EntryID $aResult[5] = $oFolder.FolderPath Return $aResult EndFunc ;==>_OL_FolderAccessEX 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...
rudi Posted March 17, 2021 Author Share Posted March 17, 2021 (edited) Hello @water >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\temp\g-cut-monitoring-debug-version.au3" /UserParams +>13:04:13 Starting AutoIt3Wrapper v.18.708.1148.0 SciTE v.4.1.0.0 Keyboard:00000407 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0407) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\admin.AD\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\admin.AD\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:C:\temp\g-cut-monitoring-debug-version.au3 +>13:04:13 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\temp\g-cut-monitoring-debug-version.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop @@ Debug(60) : $sFolder = \\g-cut\\ >Error code: 0 @@ Debug(65) : $aFolders[1] = g-cut >Error code: 0 @@ Debug(69) : $aFolders[0] = 3 >Error code: 0 +>13:05:55 AutoIt3.exe ended.rc:0 +>13:05:55 AutoIt3Wrapper Finished. >Exit code: 0 Time: 102.3 Edited March 17, 2021 by rudi Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
water Posted March 19, 2021 Share Posted March 19, 2021 Looks good so far. But I still do not understand why we get a Keyword in Row 5 😣 Could you please post the marked value when right clicking on the store and selecting properties ("Datendateieigenschaften"). 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...
rudi Posted March 30, 2021 Author Share Posted March 30, 2021 Hello, I missed your last answer, sorry for the delay: and for the inbox: Regards, rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
water Posted March 31, 2021 Share Posted March 31, 2021 The only difference to my folders is the "Delete offline items" (Offlineelemente löschen") button. Can you please run the _OL_StoreGet.au3 example script and post the result (please make sensible information unreadable). So we can check if this is an offline folder and which type. 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