L
Larry
Here's a macro I use to get rid of any extra formatting that's been
applied on top of text in the document in addition to the styles, in
order to return the document to its proper style formatting. I use this
macro by itself and also run it from some other macros, and it works
fine. Then I was thinking, since this macro has to stop at each
paragraph in the document, maybe it's slowing things up more than
necessary, and maybe I should use the Search and Replace operation
instead since that works so fast. But then I tested the macro on a
fairly long, 60-page, 160-paragraph document, and the macro was
completed almost instantaneously, in a fraction of a second. So I'm
wondering (very basic question I realize), how does it work so fast?
Another question: is there VBA code that would return the exact time
that a macro takes to run?
Dim myPara As Paragraph
For Each myPara In ActiveDocument.Paragraphs
myPara.Style = myPara.Style
Next myPara
Thanks,
Larry
applied on top of text in the document in addition to the styles, in
order to return the document to its proper style formatting. I use this
macro by itself and also run it from some other macros, and it works
fine. Then I was thinking, since this macro has to stop at each
paragraph in the document, maybe it's slowing things up more than
necessary, and maybe I should use the Search and Replace operation
instead since that works so fast. But then I tested the macro on a
fairly long, 60-page, 160-paragraph document, and the macro was
completed almost instantaneously, in a fraction of a second. So I'm
wondering (very basic question I realize), how does it work so fast?
Another question: is there VBA code that would return the exact time
that a macro takes to run?
Dim myPara As Paragraph
For Each myPara In ActiveDocument.Paragraphs
myPara.Style = myPara.Style
Next myPara
Thanks,
Larry