G
Greg Maxey
I was trying to solve an OP question to remove all non-first letter text leaving a space where text was removed. First stab was:
Sub ScratchMacro()
Dim oWord As Word.Range
Dim oChr As Word.Range
Dim myRng As Word.Range
For Each oWord In ActiveDocument.Range.Words
For Each oChr In oWord.Characters
If Not oChr = oWord.Characters.First _
And Not oChr = " " Then
oChr.Text = " "
End If
Next oChr
Next
This resulted in a continous loop. Can someone explain what is causing the loop?
Thanks.
Sub ScratchMacro()
Dim oWord As Word.Range
Dim oChr As Word.Range
Dim myRng As Word.Range
For Each oWord In ActiveDocument.Range.Words
For Each oChr In oWord.Characters
If Not oChr = oWord.Characters.First _
And Not oChr = " " Then
oChr.Text = " "
End If
Next oChr
Next
This resulted in a continous loop. Can someone explain what is causing the loop?
Thanks.