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

Free Support Forum - aspose.com

Mail merge mustache and IF

Hi,
Is it possible to use mustache syntax even for IF fields ? I mean not using MSWord Merge Fields capabilities…
I was trying to build a template not using MSWord…

Thanks

Hi Simone,

Thanks for your query. Yes, you can achieve your requirements using Aspose.Words. You can enable mail merging into plain text fields by enabling the MailMerge.UseNonMergeFields property and can freely mix them in your template with the Microsoft Word fields such as IF or Formula fields. See the following example of “Mustache” template syntax for mail merge.

{ IF {{isTrue}} = True “{{#foreach NotCompleted}}{{Name}}{{/foreach NotCompleted}}” * MERGEFORMAT }

I suggest you please read following documentation link for your kind reference.
https://docs.aspose.com/words/java/mail-merge-template-from-mustache-syntax/

Please let us know if you have any more queries.

Hi, thanks for the answer, but i’d like not to use MSword fields, only mustache…

Hi Simone,

Thanks for your inquiry. Could you please share some more detail about your query along with input word document? We will then provide you more information on this along with code.