Report errors when doing the mailmerge operation

When i use doc.getMailMerge().getFieldNames(), it returns a different list than the one in the document.
for example here is the list that he is returning :
quantité_commandée, code_produit, libellé_produit, Suppléments, Groupe_commande, code_produit, numéro_du_produit, code_groupe_gaits, groupe_produit, phénotype_produit
And here is the list he is supposed to be returning :
quantité commandée,quantité preparée,quantité livrée,libellé produit,code produit,Suppléments,code produit code 128,Groupe commande, COL01, COL02, COL03, COL04, COL05, COL06, COL07, COL08,COL09,COL10,COL11,COL12,COL13,COL14,COL15,COL16,COL17,COL18,COL19,COL20,COL21,COL22,COL23,COL24,COL25"
Here is the code that i am using :
Document doc = null;
doc = new Document(“C:\courrier\SMTS\distribution\Bc_nomin.doc”);
List fieldNames = Arrays.asList(doc.getMailMerge().getFieldNames());


Could you please ZIP and attach your input Word document here for testing? We will investigate the issue and provide you more information on it.

Here is the document that i (13.2 KB)


We have tested the scenario and noticed that MailMerge.GetFieldNames returns no mail merge field name for your document. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-22086. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.


We have closed this issue (WORDSNET-22086) as ‘Not a Bug’.

Please use the latest version of Aspose.Words for Java 21.3 to get the desired output.