Jump to content

Internet Explorer text area scroll?


Recommended Posts

How can you scroll to the end of a text area in IE without using focus/ControlSend? I have tried several solutions (see code below) but I can't seem to get them to work.

Test HTML (test.html)

<!DOCTYPE html>
        <textarea id="textarea-test" rows="4" cols="50">


AutoIt Test Code:

#include <IE.au3>

$oIE = _IECreate(@ScriptDir & "\test.html")

Local $hWnd = _IEPropertyGet($oIE, "hwnd")

Local $oTextarea = _IEGetObjById($oIE, "textarea-test")

Local $sText = ""
For $i = 1 To 30
    $sText &= $i & "&#13;&#10;"
    _IEPropertySet($oTextarea, "innerhtml", $sText)

    ;$oTextarea.document.parentwindow.scroll(0, 99999)
    ;_IEAction($oTextarea, "scrollintoview")

    ;$iDocHeight = $oTextarea.document.body.scrollHeight()
    ;$oTextarea.document.parentwindow.scrollTo(0, $iDocHeight)

    ;$oTextarea.document.parentwindow.scrollTo(0, 99999)


    _IEAction($oTextarea, "focus")
    ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "^{end}")




Edited by Herb191
edited code
Link to comment
Share on other sites

Link to comment
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

  • Create New...