Sign in to follow this  
Followers 0
Nezoic

Read all items in IE ComboBox?

3 posts in this topic

#1 ·  Posted (edited)

Anyone know how I can read all items in an IE combo box? I can read the selected item via _IEFormElementGetValue but it only returns the selected value of that form element.

Edited by Nezoic

Share this post


Link to post
Share on other sites



Anyone know how I can read all items in an IE combo box? I can read the selected item via _IEFormElementGetValue but it only returns the selected value of that form element.

I don't know of an _IE function which will do this for you, but you could always search through the source using _IEDocReadHTML() and _StringRegExp().

Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

Share this post


Link to post
Share on other sites

Modified from one of the examples in the help file:

; *******************************************************
; Example n - Open a browser with the form example, get reference to form, get reference
;              to select element, get a reference to the Option tags, loop through displaying text.
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("form")
$oForm = _IEFormGetObjByName ($oIE, "ExampleForm")
$oSelect = _IEFormElementGetObjByName ($oForm, "selectExample")
$colItems = _IETagNameGetCollection($oSelect, "Option")
$sMsg = ""
$n = 0
For $oItem In $colItems
    $sMsg &= $n & ": " & $oItem.text & @LF
    $n += 1
Next
MsgBox(64, "Results", $sMsg)

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0