Displaying Multiple Items Inline Instead of Line-by-Line in a Moustache Template using foreach

Hello Aspose Team,

I am working with Aspose.Words to generate documents using the Moustache template syntax. I have encountered an issue where I need to list participants in a document, separated by commas. Here is the part of the template I am working with:

Participants :
{{ TableStart:PropertyUser#417 }} {{Name}} {{FirstName}}, {{ TableEnd:PropertyUser#417 }}

Currently, this lists all participants line by line. However, I would like to modify it to list all participants in a single line, separated by commas. Could you guide me on how to adjust the template so that it includes a comma after each participant except the last one?

Any advice or examples would be greatly appreciated.
Thank you,
Nicolas

@nico.dynflo You should specify MailMerge.UseWholeParagraphAsRegion to false to achieve what your need. For example see the following code:

DataTable dt = new DataTable("PropertyUser#417");
dt.Columns.Add("Name");
dt.Columns.Add("FirstName");
dt.Rows.Add("Bond", "James");
dt.Rows.Add("Dou", "John");

Document doc = new Document("C:\\Temp\\in.docx");
doc.MailMerge.UseNonMergeFields = true;
doc.MailMerge.UseWholeParagraphAsRegion = false;
doc.MailMerge.ExecuteWithRegions(dt);
doc.Save("C:\\Temp\\out.docx");