Function Reference


_IEBodyWriteHTML

Replaces the HTML inside the <body> tag of the document

#include <IE.au3>
_IEBodyWriteHTML ( ByRef $oObject, $sHTML )

Parameters

$oObject Object variable of an InternetExplorer.Application, Window or Frame object
$sHTML The HTML string to write to the document

Return Value

Success: None
Failure: 0 or -1 and sets the @error flag to non-zero.
@error: 1 ($_IEStatus_GeneralError) - General Error
2 ($_IEStatus_COMError) - COM Error in Object reference
3 ($_IEStatus_InvalidDataType) - Invalid Data Type
4 ($_IEStatus_InvalidObjectType) - Invalid Object Type
6 ($_IEStatus_LoadWaitTimeout) - Load Wait Timeout
8 ($_IEStatus_AccessIsDenied) - Access Is Denied
9 ($_IEStatus_ClientDisconnected) = Client Disconnected
@extended: Contains invalid parameter number

Remarks

You may use _IEBodyReadHTML() to read the current HTML contents of the document body, manipulat that string and then write it back with _IEBodyWriteHTML().
You may also use _IEDocInsertHTML(), _IEDocInsertText() and the innerHTML, innerText, outerHTML and outerText features of _IEPropertyGet() and _IEPropertySet() to control specific elements without rewriting large blocks of text.

Related

_IEBodyReadHTML, _IEBodyReadText, _IEDocInsertHTML, _IEDocInsertText, _IELoadWait, _IEPropertyGet, _IEPropertySet

Example

; Open a browser with the iFrame example, get a reference
; to the iFrame with a name of "iFrameTwo" and replace its body HTML

#include <IE.au3>

Local $oIE = _IE_Example("iframe")
Local $oFrame = _IEFrameGetObjByName($oIE, "iFrameTwo")
_IEBodyWriteHTML($oFrame, "Hello <b><font color=red>iFrame!</font></b>")