Bookmark specific complex cells in a Word document

I have a rather complex Word document that can have cells which are comprised of merged/split cells.

Note that in the table, which is surrounded by other stuff like paragraphs, the rows can be different. And not all cells are split like the example, just a select few.

I need to be able to somehow bookmark a cell (really column at the cell position) from top-to-bottom only like the one shaded in blue because they need to be processed differently. I do not want to bookmark the row, just the column/cell.

See the attached document inside the zip. The area i need to bookmark is shaded in blue.

example.PNG (11.6 KB)

example.zip (20.4 KB)

@kjq-1

Unfortunately, Aspose.Words does not support the requested feature at the moment. However, we have logged this feature request as WORDSNET-18882 in our issue tracking system. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

@kjq-1

Please use the following code example to get the desired output. Please let us know if this helps you. We will then close WORDSNET-18882.

Document doc = new Document("example.docx");

DocumentBuilder builder = new DocumentBuilder(doc);

// Move to needed cell
builder.MoveToCell(0, 0, 2, 0);

// Insert the bookmark start
builder.StartBookmark("bk1");

builder.MoveToCell(0, 8, 3, 0);

// Insert the bookmark end
builder.EndBookmark("bk1");

builder.Document.Save("out.docx");

I see what you are trying to do (I think) but even when I apply that code above to a table I do not see just the column I want bookmarked. In fact, I see the whole row bookmarked.

    final DocumentBuilder builder = new DocumentBuilder(source);
    builder.moveToCell(1, 2, 1, 0);
    builder.startBookmark("test");
    builder.moveToCell(1, 10, 1, 0);
    builder.endBookmark("test");
    source.save("bin/generated-bookmark.docx");

In the case above I would of expected column 1 rows 2-10 to be bookmarks (the “column” from top to bottom only).

@kjq-1

Thanks for your feedback. We will inform you via this forum thread once there is an update available on this issue.

The issues you have found earlier (filed as WORDSNET-18882) have been fixed in this Aspose.Words for .NET 21.1 update and this Aspose.Words for Java 21.1 update.