Add table in a specific position

Hello
I have a word document, which has a text “text_0”.
I want to replace the string with a table that I generated with aspose.
I generate the table correctly and I can render it in a new document.
The problems come when I have an existing document and I want to add the table in a specific position in the document.
I have tried to use DocumentBuilder to locate a specific place in the document and insert it but it is not possible.
I have tried adding a table to the docx document, to replace the table generated with aspose and it has not been possible either.

Could someone guide me?

@MikeRodriguez You can put a bookmark in the document where the table should be inserted and use DocumentBuilder.moveToBookmark method to move cursor to the bookmark and build the table at the specified position.

Great, it worked.
Thank you so much

1 Like

When I insert the table, the content that exists on the following pages is moved to other pages.
It shouldn’t since the table occupies a single page.
How do I avoid this side effect?

Thank you
all the best

@MikeRodriguez This is expected behavior. MS Word documents are flow by their nature, so there is no Page concept. When table or any other content is inserted into the document, the following document’s content is reflowed.