Aspose Word access to next paragraph of a table

Hi…
I want to remove a table and also an empty line in a pharagraph which is come after from the table. So I removed the table but couldnt remove next empty paragraph line. Because I couldn’t access?
Could you help me to access the paragraph line with DocumentBuilder.Move etc.?

Hi there,

Thanks for your inquiry. It would be great if you please share following detail for investigation purposes.

  • Please attach your input Word document.
  • Please attach your target Word document showing the desired behavior. You can
    use Microsoft Word to create your target Word document.

We will investigate how you want your final Word output be generated like. We will then provide you more information on this along with code.

Thanks for reply…
Actually the problem is very simple but I think I didnt explained clearly.
So I attached a docx file. First page is input and the second page is output sample. I removed table 2 programmaticaly and at least I want to remove next empty line…

Hi there,

Thanks for sharing the detail. Please use following code example to achieve your requirements. Hope this helps you. Please let us know if you have any more queries.

Document doc = new Document(MyDir + "SampleInput.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
Table table = (Table)doc.GetChild(NodeType.Table, 1, true);
Paragraph para = (Paragraph)table.NextSibling;
table.Remove();
para.Remove();
doc.Save(MyDir + "Out.docx");

Thank you very much indeed…

Hi there,

Thanks
for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.