Template for creating Avery 5161 labels

I am trying to create Avery 5161 labels using simple mail merge. Based on my research on this forum I have to add NEXT field to move to the next record in the datasource.

The template has 20 labels. Issue is if the number of rows in datasource are NOT 20,40,60,80… etc then the template prints merge field names as it is for remaining labels.

For example my datasource has 4 rows. So it prints first 4 labels fine but it also prints 16 labels with field names Please see the attached **Sample.zip (18.8 KB)
** which has template and corresponding output document

@Laksh,

Thanks for your inquiry. Please use MailMerge.DeleteFields method to remove mail merge related fields from the document. This method removes MERGEFIELD and NEXT fields from the document.

doc.MailMerge.DeleteFields();
doc.Save(MyDir + "Out.docx");