Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "<[0-9]{1,4}>?????"
.Replacement.Text = ""
.Forward = True
.Format = False
.Wrap = wdFindStop
.MatchWildcards = True
.Execute
End With
Do While .Find.Found
If InStr(.Text, " ") > 0 Then
Select Case Split(.Text, " ")(1)
Case "B.C."
.Text = .Text & " (chinese year " & Split(.Text, " ")(0) + 2699 & ")"
Case "A.D."
.Text = .Text & " (chinese year " & Split(.Text, " ")(0) + 2698 & ")"
Case Else
.End = .Words.First.End
.Text = .Text & " (chinese year " & .Text + 2698 & ")"
End Select
Else
.End = .Words.First.End
.Text = .Text & " (chinese year " & .Text + 2698 & ")"
End If
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
Application.ScreenUpdating = True
End Sub
Do note, however, that the code will now insert the text after any 4-digit number; numbers of other lengths will be ignored.
PS: Please give the magenta a rest...