Originally Posted by
saban
In the text there should be no Bold text at all and then this code exits loop if there is
even one word bolded it will go into loop
I read this as you saying there should be no bold text, sorry about that.
I saw this in the help:
Do [{While | Until} condition]
[statements]
[Exit Do]
[statements]
Loop
so I think it should be like:
[vba]
Dim rng2 As Range
Set rng2 = ActiveDocument.Range.Duplicate
With rng2.Find.Font
.Bold = False
.italic = False
.Hidden = False
.Underline = False
.Name = "Times New Roman"
.Size = 12
rng2.TextRetrievalMode.IncludeHiddenText = False
End With
Do While rng2.Find.Execute
rng2.Find.Replacement.Style = ActiveDocument.Styles("Normal")
rng2.Find.Execute Replace:=wdReplaceAll
With rng2.Font
.Reset
.Bold = False
.italic = False
.Underline = False
End With
Loop
If rng2.End = ActiveDocument.Range.End Then Exit Do
rng2.Collapse wdCollapseEnd
Selection.Collapse direction:=wdCollapseEnd
If rng2.Characters(1) = Chr(13) & Chr(7) Then rng2.Move wdCharacter, 1 [/vba]
is that better?