@AvanBrouwershaven You can easily achieve this using IReplacingCallback. For example you can use the technique like in the following code example:
Document doc = new Document(@"C:\Temp\Template.docx");
FindReplaceOptions opt = new FindReplaceOptions(new ReplaceWithListCallback());
doc.Range.Replace("[RedenAfwijzing]", "ListItem1|ListItem2|ListItem3", opt);
doc.Save(@"C:\Temp\out.docx");
private class ReplaceWithListCallback : IReplacingCallback
{
public ReplaceAction Replacing(ReplacingArgs args)
{
DocumentBuilder builder = new DocumentBuilder((Document)args.MatchNode.Document);
builder.MoveTo(args.MatchNode);
string[] listItems = args.Replacement.Split('|');
// Here you can insert any content including List, Images, tables.
builder.ListFormat.ApplyBulletDefault();
foreach (string item in listItems)
builder.Writeln(item);
builder.ListFormat.RemoveNumbers();
args.Replacement = "";
return ReplaceAction.Replace;
}
}
But I think Find and Replace feature is not the best option to fill templates with data. If you have control over the template, I would suggest you to consider using Mail Merge or LINQ reporting Engine to fill your template with data.
For example for repeating items, like list items or table rows, you can use Mail Merge with Regions feature.