G'day "Jonathan West" <
[email protected]>,
Well, let's try again then shall we.
Thought experiment: We don't turn off application.screenupdating and
run a horrendously long automated edit. PDFMaker does this. What do we
see on screen? All sorts of strange little lines popping up and
artifacts galore. Why? The render engine hasn't been turned off so
it's attempting to display the screen. Sensibly it is a low priority
thread so it doesnt get much time to do an onscreen draw. When it
senses its buffer getting full it merely dumps it out to prevent the
word death through automation prevalent in early versions of Word.
So, we now turn off the render engine via
application.screenupdating=false. Word has internal buffers and caches
as well, and they start banking up with requests as the render engine
is off. Word's subsystem size is much larger than the render engines
space so it takes longer to fill up. Same ole results as before though
- Word eventually goes belly up with an invalid addressing attempt
from a chocka full buffer.
So, on truly long macros where the normal advice of "change methods to
a simpler one" cannot be used, one has to force a clear out of this
screen buffer as well. The easiest way is to just turn on visibility
and screen updating and force a refresh - the buffer empties itself on
the following doevents and your Word session is once again happy to go
back to massively mauling documents.
As it is slow you do not want to run with screenupdating on, but you
do have to let it breathe sometime or Word chokes.
I've proven it before, although it is nasty and takes a while to
demonstrate, here is what you do.
Take one very large document. At least 300 pages.
Turn off screen updating
new sub
for each char
fiddle with the char
every 500 times do an undoclear
next
turn on screen updating
end sub
It falls over. Kersplatto.
Now whack in another incremental count and do a screenupdating=true
refresh every 5000 characters or something.
It works.
Jonathan West said:
If you mean the article you submitted in Feb 2002, it was passed to me for
review by Dave and I drafted his reply to you.
I've taken another look at the article now, and it's of dubious relevance to
the problem of this particular thread.
Steve Hudson
Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email (e-mail address removed)
Products
http://www.geocities.com/word_heretic/products.html
Replies offlist may require payment.