Dave said:
Jay,
Thanks for your additional suggestions. I will implement them but do not
yet know how. Lets say I am looking at the macro in edit view.
First, how do I go about using the 'Range object' rather than the
'Selection
object'. My macros were created automatically in the Word macros recorder
wizard. However, I am not afraid to edit them by hand if necessary.
The way to go about this is to include the following 2 lines at the start of
the macro
Dim myRange as Range
Set myRange = Selection.Range
Then, everywhere else in your macro, replace "Selection" with "myRange". if
anywhere in your macro uses "Selection.Range", replace the whole of that
with just myRange.
In most cases, when you run the macro, it will work in just the same way,
but faster and without all the moving about. If you want the macro to finish
with the selection point moved to the same final location, but this line at
the end of the macro.
myRange.Select
There are a small number of things you can do with the Selection that you
can't do with a Range. if you trip up on one of these, post back and we will
help you find a workaround.
Likewise, how do I set 'ScreenUpdating' to either True or False within a
macro?
At the start of the macro, add this line
Application.Screenupdating = False
At the end, add this line
Application.Screenupdating = True
The slowness I experience can be attrributed to both the situations, i.e.
when I run the macros, I believe that I am overloading the Undo cache and
causing Word to grind to a halt.
Regularly do the following within the macro and see if it speeds up
ActiveDocument.UndoClear
Separately, I believe that the sheer size
of the documents are causing Word to respond very slowly as well. I am
not
using tables in this document, however, I have a large index at the end of
the document with over 3,400 index entries. Is the index a 'form' of
table?
No it is a field.
I think that the document it is still unresponsive even after deleting the
index and also I do not percieve any performance problems when printing
the
document. I really do appreciate your help! You could really solve a
major
productivity issue in my workday life, thanks!
If you normally work in Print view (Page view), you might also want to try
adding this to the macro, just after the Application.Screenupdating = False
statement.
ActiveDocument.ActiveWindow.View.Type = wdNormalView
and add this at the end, just before you turn screenupdating back on again
ActiveDocument.ActiveWindow.View.Type = wdPrintView
What this does is put the document into Normal view for the duration of the
macro. Normal view often works quite a bit faster as the display doesn't
have to bother so much with repagination and working out the current
contents of the headers & footers.