wordFindAndreplace("paul","Paul","c:\hello.doc") && For example
FUNCTION wordFindAndReplace
LPARAMETERS cValueTofind,cValueToreplace,cDocument
LOCAL lValue
oWord=Createobject("word.application")
oDocument=oWord.Documents.Open(cDocument)
loSelection=oWord.Selection
With loSelection.Find
.Text = cValueToFind
.Forward = .T.
.Wrap= 1
Endwith
Do While .T.
lValue = loSelection.Find.Execute
IF lValue
loSelection.Cut
loSelection.InsertBefore(cValueToReplace)
loselection.MoveRight
ELSE
EXIT
ENIF
Enddo
ENDFUNC
oWord.Visible =.T.