Hi Klaus,
how about this one,
coded with respect to speed
and with respect to avoiding repagination by inserting tags,
at least to some extend.
I think in principle it could be used in quite a variety of cases:
Sub test000()
Dim oPrg As Paragraph
Dim rWrd As Range
Dim rChr As Range
For Each oPrg In ActiveDocument.Paragraphs
If oPrg.Range.Font.Bold = False Then
oPrg.Range.Font.Reset
ElseIf oPrg.Range.Font.Bold = True Then
oPrg.Range.Font.Reset
oPrg.Range.Font.Bold = True
ElseIf oPrg.Range.Font.Bold = 9999999 Then
For Each rWrd In oPrg.Range.Words
If rWrd.Font.Bold = False Then
rWrd.Font.Reset
ElseIf rWrd.Font.Bold = True Then
rWrd.Font.Reset
rWrd.Font.Bold = True
ElseIf rWrd.Font.Bold = 9999999 Then
For Each rChr In rWrd.Characters
If rChr.Font.Bold = True Then
rChr.Font.Reset
rChr.Font.Bold = True
ElseIf rChr.Font.Bold = False Then
rChr.Font.Reset
End If
Next
End If
Next
End If
Next
End Sub
I am not sure, whether formatting something as bold,
which is bold anyway, may cause problems sometime.
--
Gruß aus Landsberg am Lech
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"