Function Reference


_IETableWriteToArray

Reads the contents of a Table into an array

#include <IE.au3>
_IETableWriteToArray ( ByRef $oObject [, $bTranspose = False] )

Parameters

$oObject Object variable of an InternetExplorer.Application, Table object
$bTranspose [optional] Boolean value specifying whether to swap the rows and columns in the output array

Return Value

Success: a 2-dimensional array containing the contents of the Table.
Failure: sets the @error flag to non-zero.
@error: 2 ($_IEStatus_COMError) - COM Error in Object reference
3 ($_IEStatus_InvalidDataType) - Invalid Data Type
4 ($_IEStatus_InvalidObjectType) - Invalid Object Type
@extended: Contains invalid parameter number

Remarks

When table cells span multiple columns or rows, blank array elements are added to properly align the results.
Data in spanning cells will be in the left or uppermost array elements.

Tables are often nested in HTML documents.
If all of your data is unexpectedly returned in a single array element, you may need to reference a more deeply nested table to this function.

Related

_IETableGetCollection

Example

Example 1

; Open a browser with the table example, get a reference to the second table
; on the page (index 1) and read its contents into a 2-D array

#include <Array.au3>
#include <IE.au3>

Local $oIE = _IE_Example("table")
Local $oTable = _IETableGetCollection($oIE, 1)
Local $aTableData = _IETableWriteToArray($oTable)

_ArrayDisplay($aTableData)

_IEQuit($oIE)

Example 2

; Same as Example 1, except transpose the output array and display
; the results with _ArrayDisplay()

#include <Array.au3>
#include <IE.au3>

Local $oIE = _IE_Example("table")
Local $oTable = _IETableGetCollection($oIE, 1)
Local $aTableData = _IETableWriteToArray($oTable, True)
_ArrayDisplay($aTableData)

_IEQuit($oIE)