FindReplaceOptionsMatchCase Property |
Namespace: Aspose.Words.Replacing
// Open the document Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); builder.Writeln("Hello _CustomerName_,"); // Check the document contains what we are about to test Console.WriteLine(doc.FirstSection.Body.Paragraphs[0].GetText()); FindReplaceOptions options = new FindReplaceOptions(); options.MatchCase = false; options.FindWholeWordsOnly = false; // Replace the text in the document doc.Range.Replace("_CustomerName_", "James Bond", options); // Save the modified document doc.Save(ArtifactsDir + "Range.ReplaceSimple.docx");