I need to proccess text by paragraphs. Next example shows taking a paragraph and removing its last character - the paragraph character. Then I proccess this text and try to replace old text with a new one. The problem is that it goes into infinite loop and freezes Word.
Sub Parser()
For Each para In ActiveDocument.Paragraphs
If Len(para.Range.Text) >= 150 Then
CleanedString = Left(para.Range.Text, Len(para.Range.Text) - 1)
'Some proccessing here
para.Range.Text = CleanedString & vbCr
End If
Next
End Sub
I also tried removing all the paragraphs and placing them back after processing, but it also failed.