Previously, when I ran the test, I simply copied the code into a new document (docx format) and ran it. Time to execute: 0 seconds
I've now saved the document in the docm format, then closed, re-opened the document and re-run the macro from post #5. Time to execute: 2.0 seconds on first run, 11.0 seconds on the second run if I don't clear the output from the first run, 2.0-3.0 seconds otherwise.
Curiously, if I change the two references to:
ActiveDocument.Windows(1).Visible
to:
Application.ScreenUpdating
Time to execute: 70 seconds!
All runs in Print Layout view.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|