Hi
Thanks for your inquiry. I think that you can try using the following code.
public void TestIsertDocumentBetwenText_105975()
{
Document doc = new Document(@"409_105975_ste\in1.doc");
Regex regex = new Regex("here");
doc.Range.Replace(regex, new ReplaceEvaluator(ReplaceAction_105975), true);
doc.Save(@"409_105975_ste\out.doc");
}
ReplaceAction ReplaceAction_105975(object sender, ReplaceEvaluatorArgs e)
{
Run run = (Run)e.MatchNode;
Run run1 = new Run(run.Document);
run1.Text = run.Text.Substring(run.Text.IndexOf(e.Match.Value) + e.Match.Value.Length);
run.Text = run.Text.Replace(run1.Text, "");
run.ParentParagraph.InsertAfter(run1, run);
DocumentBuilder builder = new DocumentBuilder(e.MatchNode.Document);
builder.MoveTo(run1);
builder.InsertBreak(BreakType.ParagraphBreak);
Document srcDoc = new Document(@"409_105975_ste\in2.doc");
InsertDocument(run.ParentParagraph, srcDoc);
return ReplaceAction.Skip;
}
I hope that this will help you.
Best regards.