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

Free Support Forum - aspose.com

Remove Space between Paragraphs in Word Document using C# .NET | Space After | Space Before | Line Spacing

how to remove space in between paragraphs using aspose.words?please see my below code i want here how to remove space in between paragraphs?

// Iterate through all paragraphs in the source document to avoid the staying paragraphs together.

foreach (Paragraph para in oCurrentDoc.GetChildNodes(NodeType.Paragraph, true))


para.ParagraphFormat.KeepWithNext = false;



Thanks for your inquiry. Please clarify, what do you mean by removing the space between paragraphs? Could you please create your target document manually by using MS WORD and attach it here along with your input Word document? I will investigate your scenario and provide you more information.

Moreover, you can try using ParagraphFormat.SpaceAfter and ParagraphFormat.SpaceBefore properties:

I hope, this will help.

Best Regards,

if user wantedly gave space between paragraph then in tht case how to handle?

if it is taking defaulty space between paragraphs how to handle?


Thanks for your inquiry. I have already answered you on how to adjust space between paragraphs in my previous post. In case you’re still having issues, please provide the sample input/output documents and the code. I need these documents and code in order to address the problem further.

Best Regards,

A post was split to a new topic: Additional space added when copying Data from one document to another

A post was split to a new topic: Remove extra vertical space between paragraph in Word DOC