Free Support Forum -

Delete blank lines

Hi There,

We’d like to be able to remove individual lines in a Word document. I’m not talking about removing entire Paragraphs here. Imagine you place the cursor in the middle of a Word document and then press:

Shift + End (to highlight the line)
Delete (to delete the line)

We’d like to be able to do exactly the same thing programmatically using Aspose. I have a Node and I want to delete everything on the same line as that node.

Thanks for your help.

Hi there,

Thanks for your inquiry.

I’m afraid a word documents are flow documents, they only store information in nodes such as paragraphs and runs - not in lines or columns. In order to render these into fixed formats such as PDF we use our own layout engine to do this. At the moment there is no public API for accessing information such as how a paragraph is laid out into lines. We will provide such a feature some time in the future.

I’m afraid in the mean time you will have to use something like a bookmark in the original template to wrap the line of text you want to remove. Then you can remove all runs between the bookmark start and bookmark end.


The issues you have found earlier (filed as WORDSNET-2978) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.