M
ML
We currently have a macro to loop through a document and cound "references"
which are marked with a specifc style so that we can find them. The issue
is that this code seems to be hanging Word and not sure why. Does anyone
have any ideas on what the issue is or a better way to handle this?
With ActiveDocument.Range.Find
.Style = "My Reference"
While .Execute
l = l + 1
If l > ActiveDocument.Range.Paragraphs.Count Then
GoTo endloop
End If
Wend
End With
endloop:
ActiveDocument.CustomDocumentProperties("RefCount") = l
which are marked with a specifc style so that we can find them. The issue
is that this code seems to be hanging Word and not sure why. Does anyone
have any ideas on what the issue is or a better way to handle this?
With ActiveDocument.Range.Find
.Style = "My Reference"
While .Execute
l = l + 1
If l > ActiveDocument.Range.Paragraphs.Count Then
GoTo endloop
End If
Wend
End With
endloop:
ActiveDocument.CustomDocumentProperties("RefCount") = l