Hi,
I have a problem in reading text from word document (.doc/.docx) bookmarks. Please help to provide some sample code in C# to read the text from Bookmarks in document.
I can go through the bookmarks as follows: The code is:-
Document document = new Document();
document.LoadFromFile(@"c:\workspace\test.doc");
document.LoadFromFile(@textBox1.Text);
//This can read the whole text from a .doc file; However I need to specifically extract text from bookmarks.
this.rtbText.Text = document.GetText();
foreach (Bookmark selection in document.Bookmarks)
{
///Need to add the code here to read the text from corresponding bookmark- from start to end.
}
Please help.
Thank you,
Prashant.