Free Support Forum - aspose.com

How to remove paragraph containing \r

Hi,

Im doing search.replace method.
I have org. template with for ex: \r.
Now when i have empty content for i want to remove the hole line.

I have tried replace on “\r”, “”, that does not work.
I have tried node.remove(), but cant use cause the node does not have parrent.
How do i remove that perticcular paragraph with just a line break?

Regards,
Karan



Hi

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

Thanks for your request. Why don’t you use Mail Merge to fill your document with data? In case of using Mail Merge, you can use RemoveEmptyParagraphs option and empty paragraphs will be automatically removed.

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

Also, I think, Mail Merge is the better approach than “find & replace”. Please see the following link to learn more about Mail Merge:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/simple-mail-merge-explained.html

Best regards.