Hi
Thank you for your interest in Aspose.Words. Yes, you can use Aspose.Words to achieve all you need.
You can use ReplaceEvaluator to change formatting of matched text. For example see the following code:
public void Test003()
{
// Open document
Document doc = new Document(@"Test003\in.doc");
// "word" will be bold and italic
Regex regex = new Regex("word");
doc.Range.Replace(regex, new ReplaceEvaluator(ReplaceInsertMergeField), false);
// Save output document
doc.Save(@"Test003\out.doc");
}
private ReplaceAction ReplaceInsertMergeField(object sender, ReplaceEvaluatorArgs e)
{
// Get MatchNode
Run run1 = (Run)e.MatchNode;
// Create Run
Run run2 = (Run)run1.Clone(true);
// Get index of match value
int index = run1.Text.IndexOf(e.Match.Value);
// split run that contains matched text
run2.Text = run1.Text.Substring(index + e.Match.Value.Length);
run1.Text = run1.Text.Substring(0, index);
run1.ParentParagraph.InsertAfter(run2, run1);
// Create document builder
DocumentBuilder builder = new DocumentBuilder(e.MatchNode.Document);
// Move to run2
builder.MoveTo(run2);
// Change font
builder.Font.Bold = true;
builder.Font.Italic = true;
// Insert value
builder.Write(e.Match.Value);
return ReplaceAction.Skip;
}
Please see the following link to learn more about ReplaceEvaluator: https://reference.aspose.com/words/net/aspose.words/range/replace/
2. I think this could be controlled by regular expression you are using to match your word.
3. You can check style of matched item in ReplaceEvaluator.
4. Unfortunately, there no way to track changes made programmatically. This is a known issue #1121 in our defect database.