How to remove the space if the field has no value after the mail merge?


#1

After I did the mail merge, I use the delete fields method to remove the field on my document.

doc.MailMerge.DeleteFields();

But after the fields are removed, word did not remove the white space and leave behind an empty line if the merge field has no value.

Is there a way to get the empty line back as this is one of the requirement from our customer.

Thanks.


#2

Try setting MailMerge.RemoveEmptyParagraphs property to true before MailMerge execution.