Jump to content

Recommended Posts

Posted (edited)

Recieving this error from my code.

IE.au3 V2.4-0 Error from function _IEDocInsertHTML, $_IEStatus_InvalidObjectType (Expected document element)

Im really quite noob with IE som Im not sure how to get a document element to use.

My goal is to get shut of the IE object scrollbars.

And I got the idea from

#include <GUIConstantsEx.au3>
#include <IE.au3>

$hGUI = GUICreate("",762,574)

Global $oIE = _IECreateEmbedded()
Global $hIE = GUICtrlCreateObj($oIE, 10, 10, 742, 554)
_IENavigate ($oIE, "http://www.yahoo.com")
$oDoc = _IEDocGetObj ($oIE)
_IEDocInsertHTML($oDoc, '<style type="text/css">BODY {overflow: hidden;}</style>')

GUISetState()

While 1
    $iMsg = GUIGetMsg()
    Switch $iMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Anyone have any tips?

$oIE.document.Body.Scroll = 'no' does not work.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted

Strange, $oIE.document.body.scroll = "no" works fine for me (IE 7).

#include <GUIConstantsEx.au3>
#include <IE.au3>

$hGUI = GUICreate("", 762, 574)

Global $oIE = _IECreateEmbedded()
Global $hIE = GUICtrlCreateObj($oIE, 10, 10, 742, 554)
_IENavigate($oIE, "http://www.yahoo.com")
$oIE.document.body.scroll = "no"
$oIE.document.body.style.border = "0px"

GUISetState()

While 1
    $iMsg = GUIGetMsg()
    Switch $iMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
Posted

Try with a normal IE window.

Also check this example:

#include <IE.au3>
$oIE = _IECreate("http://www.autoitscript.com")
$oBody = _IETagNameGetCollection($oIE, "body", 0)
_IEDocInsertHTML($oBody, "<h2>This HTML is inserted After Begin</h2>", "afterbegin")
_IEDocInsertHTML($oBody, "<h2>This HTML is inserted Before End</h2>", "beforeend")
Posted (edited)

Thanks guys.

I was unaware of $oIE.document.body.style.border = "0px" which when added, gave the desired effect.

And the _IEDocInsertHTML() example works fine too, was most likely the html I was trying to insert.

Thanks for your time and help.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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...