public static void ReplaceText() { WordFile wordFile = new WordFile(); WordDocument document = wordFile.Import(File.ReadAllBytes("Sample.docx")); WordDocumentBuilder builder = new WordDocumentBuilder(document); //Replace target text in whole document, match-case and match-whole-word are supported builder.ReplaceText("Page", "as", true, true); File.WriteAllBytes("ReplaceText.docx", wordFile.Export(document)); }