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

Free Support Forum - aspose.com

Table with bookmarks- merging cells


I’m experiencing an unexpected issue. I have a template file which contains a table. The table has some cells with static text and some cells with bookmarks.

Usually the table is made of rows with 2 cells, the first cell has static text and the second cell has a bookmark, which I am replacing programmatically. This works fine.

However, there is an issue when I use 3 cells, to have:

Static text/ bookmark/ static text

For some reason, when replacing the bookmark text, it merges cells 2 and 3.

The code I use is (basically):

For Each myBookmark As Bookmark In AwDoc.Range.Bookmarks

If myBookmark.Name.ToUpper.StartsWith(“DEMO_”) Then

mybookmark.text = "example"

End if

I don’t understand why it merges cells 2 and 3…

I have attached an example, where it has merged but should not.

“Family name” is static, “Abdullah” is bookmark text.

Help much appreciated!

Also, I am not creating the table in Aspose, this is from a Word template.

Sorry… I have realised, that replacing the bookmarks doesn’t cause it to merge, but I still don’t know why it does. Even if I leave the bookmark without replacing the text it still merges.


Thanks for your inquiry. Could you please attach your input/output Word documents and code to reproduce the issue here for testing? I will investigate the issue on my side and provide you more information.

Best regards,