Word 2003 Check for document fully loaded/paginated

T

tbone

I created a routine to glean information from a document. It takes a
fairly long time to operate since it needs to examine every character,
so I update the status bar as its working. I created a menu button to
execute this macro, which I placed in my normal.dot template.

I've found that if I load a very large document, Word goes into its
repagination mode. During that time, I can click the menu button to
run my code, but it looks like it must wait until the repagination is
complete before it even begins to run (i.e. I see no status bar
changes while the repagination is going on).

What I'd like to do is provide a way to prevent being stuck waiting
for all this to take place. One idea is to add code to see if the
document is fully loaded and repaginated, and if not, give the user
the option to cancel the operation.

Even better would be a way to put up a dialog box that shows what's
currently going on and give the user a way to cancel out of it at any
time. So perhaps the code could say "repaginating" until that's done,
and then say "processing" until that's done. At any point, the user
should be able to cancel out of it. Is this kind of thing possible in
Word 2003?

Thanks
tbone
 
T

tbone

I have found that my code does start working when the menu button is
clicked, even if the document is being repaginated. I just didn't
realize certain operations, such as:

x = ActiveDocument.Characters.Count

could take more than a minute to complete for large documents. Even
when the document is fully loaded and repaginated, some operations can
still take many tens of seconds to complete.

I have changed the code to update the status bar to indicate such
activity.

tbone
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top