Jump to content

_IEAction printdefault does not wait


frhack
 Share

Recommended Posts

Hi all

I have a problem using _IEAction ($objIE,"printdefault")

After the call I have to call 'sleep' for a few seconds (depending on the page printed)

otherwise the print fail silently

_IELoadWait ($objIE) it's not useful in this situation

I've also tried to look at the property 'busy' but without success; after the call to printdefault the property 'busy' is false.

Is there a way to solve this problem ?

thanks

Francesco

$objIE = _IECreate($CmdLine[1],0,0)

_IEAction ($objIE,"printdefault")

_IELoadWait ($objIE)

sleep(5000)

_IEAction ($objIE,"quit")

Link to comment
Share on other sites

I don't readily see a perperty to check if the print operation is in progress, but the following addition of an _IENavigate appears to offer a reliable workaround:

#include <IE.au3>
$oIE = _IECreate("www.google.com")
_IEAction ($oIE,"printdefault")
_IENavigate($oIE, "about:blank")
_IEQuit($oIE)

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

Thanks Dale,

but this does not work for me.

Have you tried with a bigger page ?

(I'm using Version 3.2.2.0 )

I don't readily see a perperty to check if the print operation is in progress, but the following addition of an _IENavigate appears to offer a reliable workaround:

#include <IE.au3>
$oIE = _IECreate("www.google.com")
_IEAction ($oIE,"printdefault")
_IENavigate($oIE, "about:blank")
_IEQuit($oIE)

Dale

Link to comment
Share on other sites

Thanks Dale,

but this does not work for me.

Have you tried with a bigger page ?

(I'm using Version 3.2.2.0 )

No, I hoped it wasn't just fortunate timing, but apparently it was.

Again, I find nothing exposed through the DOM or IE COM that lets you know that a print operation is in progress. You'll either need to simply insure that you do not quit until the file has had an appropriate amount of time to spool or look for other creative ways to check the status... looking in the print dialogue, WMI etc.

If you simply want the browser to disappear from the screen, you can use _IEAction($oIE, "invisible") and then sleep a bit before the _IEQuit().

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

  • 4 months later...

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