S
SirCodesALot
Hi,
I have a macro that is doing some indenting. Depending on the
previous paragraphs text, I may or may not have to indent all that
paragraphs children.
The problem am having is that my document has about 5000 paragraphs,
and as my index into the ActiveDocument.Paragraphs(Index) gets above
about 300, this really start slowing down... any one know why?
Here is an example of the code:
AllParagraphs = ActiveDocument.Paragraphs.Count
For i = 1 To AllParagraphs
If (ActiveDocument.Paragraphs(i).Style = sReqStyle) Then
For j = i + 1 To AllParagraphs
If (ActiveDocument.Paragraphs(j).Style =
sReqStyle) Then
If (IsSubRequirement(i, j)) Then
' indent
j = IndentRequirement(i, j) - 1
End If
End If
Next
End If
Next
As i gets above about 300, it really shows down. Is their a better
way to do this?
I have already tried turning of page updating.
thanks for your help,
-SJ
I have a macro that is doing some indenting. Depending on the
previous paragraphs text, I may or may not have to indent all that
paragraphs children.
The problem am having is that my document has about 5000 paragraphs,
and as my index into the ActiveDocument.Paragraphs(Index) gets above
about 300, this really start slowing down... any one know why?
Here is an example of the code:
AllParagraphs = ActiveDocument.Paragraphs.Count
For i = 1 To AllParagraphs
If (ActiveDocument.Paragraphs(i).Style = sReqStyle) Then
For j = i + 1 To AllParagraphs
If (ActiveDocument.Paragraphs(j).Style =
sReqStyle) Then
If (IsSubRequirement(i, j)) Then
' indent
j = IndentRequirement(i, j) - 1
End If
End If
Next
End If
Next
As i gets above about 300, it really shows down. Is their a better
way to do this?
I have already tried turning of page updating.
thanks for your help,
-SJ