I add a table to my document. I can add text to a table cell and style it (bold, italic, etc), but I don't know how to add a hyperlink to a table cell. All I see is "editor.InsertHyperlink()", but it adds the hyperlink below my table, not in my table cell.
1 Answer, 1 is accepted
answered on 23 Oct 2017, 03:42 PM
In order to insert a hyperlink inside a table cell we should first position the editor inside the cell, for example after an empty run in its paragraph.
Then we can call the editor.InsertHyperlink() method which will apply the Hyperlink style to the result fragment of the inserted field.
After that we should move the position of the editor after the table (if this is its last cell) and continue building the document.
The following code snippet demonstrates how you can achieve that: