Hello
Can you please tell me how to add a comment to a matched text (via a Replace) in a FOOTNOTE? I can add comments to specific words in the MAIN PART of a page with the following code, but just not a footnote:
var comment = new Comment(matchNode.Document, "Me", "Me", DateTime.Today);
comment.SetText("This is my comment");
// Create start and end ranges for the comment
var commentRangeStart = new CommentRangeStart(matchNode.Document, comment.Id);
var commentRangeEnd = new CommentRangeEnd(matchNode.Document, comment.Id);
// Set start and end ranges at relevant locations
matchNode.ParentNode.InsertBefore(commentRangeStart, (Node)runs[0]);
matchNode.ParentNode.InsertAfter(commentRangeEnd, (Node)runs[runs.Count - 1]);
// Insert comment
commentRangeEnd.ParentNode.InsertAfter(comment, commentRangeEnd);
However it does not work if the matched text is in a footnote.
Any help would be much appreciated. Thank you!