Jump to content

Helpfile example not working?


Recommended Posts

When running the _IECreate.au3 in the helpfile, the three windows come up, the messagebox appears. After I click ok, the fourth window comes up saying Hello World! and then a few seconds after I get a message saying

Line 51 (File "C:\Program Files\Autoit3\Examples\Helpfile\_IECreate.au3"):

Msgbox (0, "SourceForge Information", $oMarquee.innerText)

Msgbox (0, "SourceForge Information", $oMarquee^ERROR

Error: Variable must be of type "Object".

On my main computer this script works fine, I searched the forums for this error and I found a few threads.

http://www.autoitscript.com/forum/index.php?showtopic=87147

http://www.autoitscript.com/forum/index.php?showtopic=97543

-Tried installing CDO as SmOke_N said, installed cdosys.dll. I installed an internet explorer update and I have the latest autoit, along with beta.

I have tried compiling it to .exe, too. Still No luck.

I'm running windows xp professional sp3.

I would greatly appreciate your help as I have been working on this for a long time.

Thanks.

Link to comment
Share on other sites

; *******************************************************

; Example 1 - Create a browser window and navigate to a website

; *******************************************************

;

#include <IE.au3>

$oIE = _IECreate ("www.autoitscript.com")



; *******************************************************

; Example 2 - Create new browser windows pointing to each of 3 different URLs

; if one does not already exist ($f_tryAttach = 1)

; do not wait for the page loads to complete ($f_wait = 0)

; *******************************************************

;

#include <IE.au3>

_IECreate ("www.autoitscript.com", 1, 1, 0)

_IECreate ("my.yahoo.com", 1, 1, 0)

_IECreate ("www.google.com", 1, 1, 0)



; *******************************************************

; Example 3 - Attempt to attach to an existing browser displaying a particular website URL

; Create a new browser and navigate to that site if one does not already exist

; *******************************************************

;

#include <IE.au3>

$oIE = _IECreate ("www.autoitscript.com", 1)

; Check @extended return value to see if attach was successful

If @extended Then

MsgBox(0, "", "Attached to Existing Browser")

Else

MsgBox(0, "", "Created New Browser")

EndIf



; *******************************************************

; Example 4 - Create an empty browser window and populate it with custom HTML

; *******************************************************

;

#include <IE.au3>

$oIE = _IECreate ()

$sHTML = "<h1>Hello World!</h1>"

_IEBodyWriteHTML ($oIE, $sHTML)



; *******************************************************

; Example 5 - Create an invisible browser window, navigate to a website,

; retrieve some information and Quit

; *******************************************************

;

#include <IE.au3>

$oIE = _IECreate ("http://sourceforge.net", 0, 0)

; Display the innerText on an element on the page with a name of "sfmarquee"

$oMarquee = _IEGetObjByName ($oIE, "sfmarquee")

MsgBox(0, "SourceForge Information", $oMarquee.innerText) ---- LINE OF ERROR

_IEQuit ($oIE)



; *******************************************************

; Example 6 - Create a browser window attached to a new instance of iexplore.exe

; This is often necessary in order to get a new session cookie context

; (session cookies are shared among all browser instances sharing the same iexplore.exe)

; *******************************************************

;

#include <IE.au3>

ShellExecute ("iexplore.exe", "about:blank")

WinWait ("Blank Page")

$oIE = _IEAttach ("about:blank", "url")

_IELoadWait ($oIE)

_IENavigate ($oIE, "www.autoitscript.com")


Thanks for help!

 

Edited by Jon
Code formatting
Link to comment
Share on other sites

Please note that that is not ONE example, but rather 6 that are meant to be split apart before being run.

SourceForge has changed their site design since that example was written, but you should still be able to learn from it.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...