MulgraveTester
10 years agoFrequent Contributor
Shift+ClickItem in a list object causes "index 8192 is out of bounds" error
I know this was working before but now when I try to shift+click in a list object I get "The list view subitem's index 8192 is out of bounds." VBScript listObj.clickItem(2) 'Clicks the 3rd item...
- 10 years ago
SOLVED:
ListBoxes require only one index but ListViews require two. I was caught out because the help for clickItem is the same for both objects. The ListView object clickItem help should be modified to show two indexes.
The sample code should be:
listObj.clickItem(2) 'Clicks the 3rd item in the list
listObj.clickItem(0) 'Clicks the 1st item in the list
call listObj.clickItem(2, 0, skShift)
or
listObj.clickItem(2) 'Clicks the 3rd item in the list
listObj.clickItem(0) 'Clicks the 1st item in the list
if listObj.WndClass="ListBox" then call listObj.clickItem(2, skShift)
if listObj.WndClass="SysListView32" then call listObj.clickItem(2, 0, skShift)