Re: Print Automation with IE7




"geekgrrl" <geekgrrl71@xxxxxxxxxxx> wrote in message
news:1194618845.096431.292740@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Nov 9, 12:34 am, "Paul Randall" <paulr...@xxxxxxxxxxxx> wrote:
"geekgrrl" <geekgrr...@xxxxxxxxxxx> wrote in message

news:1194561409.249376.199280@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx





On Nov 8, 5:25 pm, mr_unreliable <kindlyReplyToNewsgr...@xxxxxxxxxxx>
wrote:
GeekGrrl, when you "open" the web page, are you testing
whether the page has finished loading before starting
to print?

Note: the preferred method is to use "ready state":

--- <snip> ---
Const READYSTATE_COMPLETE = 4

Do ' wait until page loaded
WScript.Sleep 10 ' allow for processing events
Loop Until oIE.ReadyState = READYSTATE_COMPLETE
--- </snip> ---

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)

geekgrrl wrote:
I'm having a problem automating printing html/web pages with IE7 and
I
am wondering if anyone else has had the same problem.

When I print large numbers of html docs or web pages, I am finding
that IE7 is occasionally sending only a single page to the printer.

My sequence is this:

set default printer
while ( files left)
{
open html file
print html, wait for completion
}

I will randomly get a print job that has only a single page; it
contains only the page header / footer information that IE prints
and
no contents.

I have been able to duplicate this with IE7 on Vista 64 and on
XPSP2.
Has anyone else seen this issue?

Geekgrrl.- Hide quoted text -

- Show quoted text -

Yes, I am, sorry I should have mentioned that.
That is originally what I thought the problem was, but I traced
through the code and the readstate is being changed by IE and I am
waiting on it.

Readystate is handy but not infallible. Some web pages may be
redirected
or due to other things seem to get done a number of times before they are
really done loading. I've asked about it before and got some interesting
replies:

http://groups.google.com/group/microsoft.public.scripting.vbscript/br...

I wound up creating the IE object with scriptable events, and used that
to
force my script to wait until the web page is really fully loaded. Let
me
know if you would like some sample script. Using object events can be
handy.

-Paul Randall- Hide quoted text -

- Show quoted text -

Paul,

Thanks for the link. There's some interesting information there that
I'm going to look into.

I'm actually not using vb script but MFC OLE/COM, but thought I would
post my question here as you can do the same thing in vb script.
The strange thing here is that the same code works flawlessly in IE6,
on all my test machines.

I've run my tests with both large(19 pages) and small(2pages) html
files on disk and actual web addresses, and I'm printing each file
20-40 times in batches.

I know IE7 has made a lot of changes to the underlying printing from
the previous versions of the browser, I'm just wondering if there
isn't a subtle problem with the print templates, as I do get the
header information, just no page contents.

Geekgrrl

Hi,
I don't use MFC OLE/COM, so I can't help you there.

Could you modify your program to scroll to the end of the web page prior to
printing, and maybe beep so that you could visually verify that the end
looks correct when the printing starts?

Maybe you have already done this, but one other thing you might do is set it
up to print to a virtual printer so testing doesn't use any trees :-)

-Paul Randall


.



Relevant Pages

  • Re: Print Automation with IE7
    ... whether the page has finished loading before starting ... print html, wait for completion ... force my script to wait until the web page is really fully loaded. ... printing in IE7 so perhaps that is what is getting in the way. ...
    (microsoft.public.scripting.vbscript)
  • Re: Print Automation with IE7
    ... whether the page has finished loading before starting ... print html, wait for completion ... force my script to wait until the web page is really fully loaded. ... I know IE7 has made a lot of changes to the underlying printing from ...
    (microsoft.public.scripting.vbscript)
  • Re: cgi - secure sessions
    ... By server side include I mean simply calling upon the script from> an include line within the html, ... Try printing the contents of os.getenvin your script and see if the cookie data is in there. ...
    (comp.lang.python)
  • Cant make this page work
    ... I can't make this script work properly. ... The script at the bottom of the html page ... Does someone have a perl ... sub output_trace_headers { ...
    (comp.lang.javascript)
  • Re: Use with Action "Send Reply" Dont Go
    ... Set Up an HTML Signature ... Go to Tools/Signatures in Entourage, ... "Auto-Reply HTML" or something similar. ... script in the Entourage Script Menu Items folder. ...
    (microsoft.public.mac.office.entourage)