I am using your outlookEX provided by "Water" to much success however I have come across an issue. I have a script which simply reads the content of an inbox and then interrogates the result. It appears if I run the script against a subfolder in the inbox I get no issues. If I then point it to the inbox root which is being updated often with new email I get errors from the below line
"C:\Program Files (x86)\AutoIt3\Include\outlookEX.au3 (2678) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$aItems[$iCounter][$iIndex - 1] = $oItem.ItemProperties.Item($aReturnProperties[$iIndex]).value
^ ERROR"
I believe the reason why this occurs is the inbox grows in size with new emails coming in while I am interrogating it with the below command
$oOutlook = _OL_Open()
$Folder = _OL_FolderAccess($oOutlook, "", $olFolderInbox)
If I copy all the emails into a subfolder in the inbox and point the above line to the subfolder it does not fail backing my theory this is down to the inbox receiving updates and the array in the outlookex code not handling this.
The line error in the outlookex that triggers the above error is line 2673 of outlookex. I have included below a snippet of outlookEX where the error occurs
The line that triggers the error is "$aItems[$iCounter][$iIndex - 1] = $oItem.ItemProperties.Item($aReturnProperties[$iIndex]).value"
What is interesting is if I change the "$icounter +=1" to $icounter = 1 I never get the error but the result I get back is different so I clearly cannot mess about with this value. I believe this is the fact that the $aReturnProperties[0] is defined and this is a static value and may need to be a dynamic ubound value that is checked each time the loop is processed to stop it getting annoyes as the mailbox grows past the initial ubound value when the loop started
I have attached a copy of WATERS outlookEX function that I am using
For $oItem In $oItems If $oItem.Class <> $iObjectClass Then ContinueLoop ; Get all properties of first item and check for existance and correct case If BitAND($iFlags, 4) <> 4 And Not $bChecked Then If Not __OL_CheckProperties($oItem, $aReturnProperties, 1) Then Return SetError(@error, @extended, "") $bChecked = True EndIf If $sSearchName <> "" And StringInStr($oItem.ItemProperties.Item($sSearchName).value, $sSearchValue) = 0 Then ContinueLoop ; Fill array with the specified properties $iCounter += 1 If BitAND($iFlags, 4) <> 4 Then For $iIndex = 1 To $aReturnProperties[0] $aItems[$iCounter][$iIndex - 1] = $oItem.ItemProperties.Item($aReturnProperties[$iIndex]).value If @error Then Return SetError(4, @error, "") If BitAND($iFlags, 2) = 2 And $iCounter = 1 Then $aItems[0][$iIndex - 1] = $oItem.ItemProperties.Item($aReturnProperties[$iIndex]).name Next EndIf If BitAND($iFlags, 4) <> 4 And BitAND($iFlags, 2) <> 2 Then $aItems[0][0] = $iCounter Next