Re: Print Automation with IE7
- From: geekgrrl <geekgrrl71@xxxxxxxxxxx>
- Date: Tue, 13 Nov 2007 12:05:05 -0800
On Nov 12, 5:56 pm, "Paul Randall" <paulr...@xxxxxxxxxxxx> wrote:
"geekgrrl" <geekgrr...@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- Hide quoted text -
- Show quoted text -
Paul,
I am using a virtual printer already :D, I am actually testing batch
printing to this printer, and of course it all has to be silent and
hidden.
I've added an extra wait check with the Application.Busy flag, and in
preliminary testing seems to be stable but I've got to hammer on it
for a while yet until I'm satisfied.
Thanks for all the feedback.
Geekgrrl
.
- Follow-Ups:
- Re: Print Automation with IE7
- From: Paul Randall
- Re: Print Automation with IE7
- References:
- Print Automation with IE7
- From: geekgrrl
- Re: Print Automation with IE7
- From: mr_unreliable
- Re: Print Automation with IE7
- From: geekgrrl
- Re: Print Automation with IE7
- From: Paul Randall
- Re: Print Automation with IE7
- From: geekgrrl
- Re: Print Automation with IE7
- From: Paul Randall
- Print Automation with IE7
- Prev by Date: Re: How to get Err.Description
- Next by Date: Re: Need help with style.visibility with underscore in field name Error
- Previous by thread: Re: Print Automation with IE7
- Next by thread: Re: Print Automation with IE7
- Index(es):
Relevant Pages
|