Use the replace function to change the colour of your key words/phrases eg
create a one column table with the Words or phrases to be changed and save
it. Enter the name and path of the table document where indicated.
Enter the formatting parameters you wish to add to the found texts at the
second place indicated - add or remove whichever formatting parameters you
require - see
http://www.gmayor.com/installing_macro.htm
The replace function will only replace the text selected and not the spaces.
Sub ReplaceFromTableList()
Dim ChangeDoc As Document, RefDoc As Document
Dim ctable As Table
Dim oldpart As Range
Dim i As Long
Dim sFname As String
'********************************************
'Name of document with table list
sFname = "D:\My Documents\Changes.doc"
'********************************************
Set RefDoc = ActiveDocument
Set ChangeDoc = Documents.Open(sFname)
Set ctable = ChangeDoc.Tables(1)
RefDoc.Activate
For i = 1 To ctable.Rows.Count
Set oldpart = ctable.Cell(i, 1).Range
oldpart.End = oldpart.End - 1
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
'****************************************
'set formatting options
.Replacement.Font.Color = wdColorRed
.Replacement.Font.Size = "14"
.Replacement.Font.Name = "Arial"
.Replacement.Font.Italic = True
.Replacement.Font.Bold = True
'****************************************
.Execute findText:=oldpart, _
ReplaceWith:="^&", _
replace:=wdReplaceAll, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue
End With
Next i
ChangeDoc.Close wdDoNotSaveChanges
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>