Free Support Forum -

Remove Field

If I have the index value of a merge field, how can I remove it?


Thanks for your request. Merge field will be removed if you fill it with empty data. See the following code.

Document doc = new Document(@"\in.doc");

int index = 1;

string[] names = doc.MailMerge.GetFieldNames();

doc.MailMerge.RemoveEmptyParagraphs = true;

doc.MailMerge.Execute(new string[] { names[index] }, new string[] { string.Empty });


I hope that it will help you.

Best regards.