We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Mustache templates and aspose word mergi

I am upgrading a system that used to your Aspose.
I want to mail merge into a word document/template using mustache syntax for field names…
Do you have sample code that will do this… i found MailMerge.Execute but that seems wrong for this as i have to supply the list of fields ands values…
I want a user defined word document containing mustache syntax field names and then i want to pass a complex C# object
and have it correspond the the stytax
I will not know the tags on the way in as they are user created but I will provide the complex models that maps to the fieldnames they can enter thank you

is there any concept of for loops that are supported using mustache loops
Maybe a list of Contacts and then extracting their names and contact numbers into a word table row for each

thank you

@gordonpulse In mustache syntax you cannot use complex C# objects. You should specify field name, like in regular merge fields:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

doc.MailMerge.UseNonMergeFields = true;
doc.MailMerge.Execute(new string[] { "MyField" }, new object[] { "Some Value" });


I think, in your case, LINQ Reporting Engine will better fit your requirements.