Sub TagAndClearFormating()
Dim oRng As Word.Range
Dim arrTagPairs() As String, arrTags() As String
Dim arrChars() As String, arrEntities() As String
Dim lngIndex As Long
arrTagPairs = Split("<i><b>*</i></b>|<i>*</i>|<b>*</b>|<u>*</u>", "|")
For lngIndex = 0 To UBound(arrTagPairs)
arrTags = Split(arrTagPairs(lngIndex), "*")
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
If InStr(arrTags(0), "b") > 0 Then .Font.Bold = True
If InStr(arrTags(0), "i") > 0 Then .Font.Italic = True
If InStr(arrTags(0), "u") > 0 Then .Font.Underline = True
While .Execute
With oRng
If InStr(arrTags(0), "b") > 0 Then .Font.Bold = False
If InStr(arrTags(0), "i") > 0 Then .Font.Italic = False
If InStr(arrTags(0), "u") > 0 Then .Font.Underline = False
If .Characters.Last = vbCr Then .End = .End - 1
.Text = arrTags(0) & .Text & arrTags(1)
.Collapse wdCollapseEnd
End With
Wend
End With
Next lngIndex
arrChars = Split("38|34|39|145|146|147|148|162", "|")
arrEntities = Split("&|"|'|'|'|&|&|¢", "|")
For lngIndex = 0 To UBound(arrChars)
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Text = Chr(arrChars(lngIndex))
.Replacement.Text = arrEntities(lngIndex)
.Execute Replace:=wdReplaceAll
End With
Next lngIndex
End Sub