Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I get page number and section name of word document while reading comment in c#

What I have tried:

Quote:
foreach (WORD.Comment comment in objDoc.Comments)
{

comment.Range.WholeStory();

int page = 0;
string[] details = new string[5];
details[0] = comment.Range.Text.ToString();
details[1] = comment.Author;
details[2] = comment.Date.ToString();
// details[3] = section.Index.ToString();
// details[3] = comment.Range.PageSetup.LineNumbering.ToString();
// details[3] = comment.Range.PageSetup.SectionStart.ToString();
//page = comment.Range.get_Information(WORD.WdInformation.);
details[3] = page.ToString();
xlWorkSheet.Cells[comment.Index + 2, 1] = details[1];
xlWorkSheet.Cells[comment.Index + 2, 2] = details[0];
xlWorkSheet.Cells[comment.Index + 2, 3] = details[2];
xlWorkSheet.Cells[comment.Index + 2, 4] = details[3];
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900