Insert Bookmark at the End of all Cells in Table Row in Word Document using C# .NET Code | Cell Level Bookmarks

Hello, how can I add a brand new bookmark to the “end” of a row?
Not inside of the last cell but just right of it, out of the table.
See screenshot.

Using c#

Many thanks

Capture.JPG (11.4 KB)

@Zan135,

You can use the following C# code of Aspose.Words for .NET API to insert a Bookmark at the end of all Cells in a Table Row in Word document:

Document doc = new Document("C:\\Temp\\input.docx");
DocumentBuilder builder = new DocumentBuilder(doc);

Row row = doc.FirstSection.Body.Tables[0].FirstRow;

BookmarkStart start = builder.StartBookmark("Cell Level Bookmark");
BookmarkEnd end = builder.EndBookmark("Cell Level Bookmark");

row.InsertAfter(end, row.LastCell);
row.InsertAfter(start, row.LastCell);

doc.Save(@"C:\Temp\21.2.docx");
1 Like