For example:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "\<[! ]@\>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchWildcards = True
.Execute
End With
If .Find.Found = False Then
MsgBox "No tags found", vbExclamation
End If
Do While .Find.Found = True
.Style = Split(Split(.Text, "<")(1), ">")(0)
.Text = vbNullString
.Find.Execute
Loop
End With
Application.ScreenUpdating = True
End Sub