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

Free Support Forum - aspose.com

Removing blank address lines

Hi,

When using Aspose.Words to mail merge documents for letters to our clients, some of the the merge fields we use in the address section may be blank. Is there any in-built support for removing such fields if they have not be merged with data?

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. You can use MailMerge.DeleteFields method to remove non-merged fields from document. See the following link for more information.

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.reporting.mailmerge.deletefields.html

Also you can use RemoveEmptyParagraphs property

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.reporting.mailmerge.removeemptyparagraphs.html

I hope this could help you.

Best regards.