Can anyone help me in getting the page numbers of comments entered in a word document using Open XML SDK in C#
Extract from my code:
using (WordprocessingDocument wordDoc = WordprocessingDocument.Open("C:/temp/doc1.docx", false)) { WordprocessingCommentsPart commentsPart = wordDoc.MainDocumentPart.WordprocessingCommentsPart; if (commentsPart != null && commentsPart.Comments != null) { foreach (Comment comment in commentsPart.Comments.Elements<Comment>()) { SPList list = web.Lists["UserFeedback"]; SPListItem itemToAdd = list.Items.Add(); itemToAdd["Title"] = filename.Name.ToString(); itemToAdd["Feedback"] = comment.Author.InnerText; itemToAdd["UserComments"] = comment.InnerText; itemToAdd["UserInitials"] = comment.Initials; itemToAdd["PageNumber"] = ""; itemToAdd["Section"] = ""; itemToAdd.Update(); } } wordDoc.Close(); wordDoc.Dispose(); }
Any help is appreciated.
Regards,
Vijay.