Function Reference


Returns an object reference to a Form Element by name

#include <IE.au3>
_IEFormElementGetObjByName ( ByRef $oObject, $sName [, $iIndex = 0] )


$oObject Object variable of an InternetExplorer.Application, Form object
$sName Specifies the name of the Form Element you wish to match
$iIndex [optional] If the Form Element name occurs more than once, specifies instance by 0-based index
    0 (Default) or positive integer returns an indexed instance
    -1 returns a collection of the specified Form Elements

Return Value

Success: an object variable pointing to the Form Element object, @extended = form count.
Failure: sets the @error flag to non-zero.
@error: 3 ($_IEStatus_InvalidDataType) - Invalid Data Type
4 ($_IEStatus_InvalidObjectType) - Invalid Object Type
7 ($_IEStatus_NoMatch) - No Match
@extended: Contains invalid parameter number


If the desired form element does not have a name or ID, _IEFormElementGetCollection() to get a reference by index.


_IEFormElementGetCollection, _IEFormElementGetValue, _IEFormElementSetValue, _IEFormSubmit


; Get a reference to a specific form element by name.
; In this case, submit a query to the Google search engine

#include <IE.au3>

Local $oIE = _IECreate("")
Local $oForm = _IEFormGetObjByName($oIE, "gbqf")
Local $oQuery = _IEFormElementGetObjByName($oForm, "q")
_IEFormElementSetValue($oQuery, "AutoIt IE.au3")