Author: Tomas Rutkauskas How to search and replace text in a Word document Answer: Solve 1: You should use a variant because the Find.Execute method is a bit buggy. Something like this, for example: 1 { ... } 2 var 3 Rnge: OleVariant; 4 { ... } 5 6 Rnge := Doc.Content; 7 Rnge.Find.Execute('old', Wrap := wdFindContinue, ReplaceWith := 'new', Replace := 8 wdReplaceAll); 9 { ... } Solve 2: 10 { ... } 11 { Create the OLE Object } 12 WordApp := CreateOLEObject('Word.Application'); 13 WordApp.Documents.Open(yourDocFile); 14 WordApp.Selection.Find.ClearFormatting; 15 WordApp.Selection.Find.Text := yourOldStr; 16 WordApp.Selection.Find.Replacement.Text := yourNewStr; 17 WordApp.Selection.Find.Forward := True; 18 WordApp.Selection.Find.Wrap := 1; {wdFindContinue} 19 WordApp.Selection.Find.Format := False; 20 WordApp.Selection.Find.MatchCase := False; 21 WordApp.Selection.Find.MatchWholeWord := False; 22 WordApp.Selection.Find.MatchWildcards := True; 23 WordApp.Selection.Find.MatchSoundsLike := False; 24 WordApp.Selection.Find.MatchAllWordForms := False; 25 WordApp.Selection.Find.Execute(Replace := 2); {wdReplaceAll} 26 {Or as alternative: WordApp.Selection.Find.Execute(Replace := 1); for one replace} 27 WordApp.ActiveDocument.SaveAs(yourNewDocFile); 28 WordApp.Quit; 29 WordApp := Unassigned; 30 { ... }