Sign in to follow this  
Followers 0
JohnOne

_IEDocInsertHTML

4 posts in this topic

#1 ·  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.

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

#4 ·  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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0