VBA - Visual Basic for Applications is your tool for this type of work in Office. It stays self-contained as well.
Shows manipulating text.
http://computerprogramming.suite101.com/article.cfm/introduction_to_vba_for_ms_word
VBA Tutorial:
http://jy.fridaynight.co.il/pages/dev/WordVBA.php
Bunch of examples.
http://www.thezcorp.com/VBACodeSamples.aspx
A Cornucopia:
http://www.java2s.com/Code/VBA-Excel-Access-Word/CatalogVBA-Excel-Access-Word.htm
Now that you know what to search for as well, hopefully you are on your way.
EDIT: Found this code example:
Sub ChangeColor
Options.DefaultHighlightColorIndex = wdBrightGreen
Selection.Find.ClearFormatting
Selection.Find.Highlight = True
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Highlight = True
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Font.Color = wdColorBrightGreen
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.Color = wdColorRed
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
HTH