R
Robert Flanagan
I use code like the following:
N = ActiveDocument.Paragraphs.Count
For I = N To 1 Step -1
If ActiveDocument.Paragraphs(I).Style =
ActiveDocument.Styles("Heading 2") Then
'code to do tasks
End If
Next
However, the document is very long, about 500 pages and the paragraph count
is about 6,500. So, when I run the macro, I go for a long walk or take a
nap. I do the code using "Step -1" as in quite a few instances I am
deleting the heading 2 paragraph if they meet a certain test.
Most of the time is takend doing the check of each paragraph. I put
application.statusbar = I to confirm this. What is a faster way to find the
styles and check? I will often have two heading 2 styles next to each other
and delete one.
Bob
N = ActiveDocument.Paragraphs.Count
For I = N To 1 Step -1
If ActiveDocument.Paragraphs(I).Style =
ActiveDocument.Styles("Heading 2") Then
'code to do tasks
End If
Next
However, the document is very long, about 500 pages and the paragraph count
is about 6,500. So, when I run the macro, I go for a long walk or take a
nap. I do the code using "Step -1" as in quite a few instances I am
deleting the heading 2 paragraph if they meet a certain test.
Most of the time is takend doing the check of each paragraph. I put
application.statusbar = I to confirm this. What is a faster way to find the
styles and check? I will often have two heading 2 styles next to each other
and delete one.
Bob