In a Windows forms app I am reading a word document, processing the text and showing in RichTextBox control.
My issue is that to access the data from Header-Footer & TextBoxes (MsoShapeType.msoTextBox/msoAutoShape) I will have to loop through all Sections & Shapes explicitly. Rest all information I am able to get through doc.Content.Text. Here I am losing the sequence of the data.
for example
1. If the word file has few paragraphs first and then a msoTextBox.
2. If the word file has msoTextBox first and then paragraph.
What should I do to read the data/text from top to bottom? I thought about converting the file in text and then read but then I will lose the formatting of word and all data from all containers as well.
Is there any way to get all data of the word file through only a single property irrespective of any container (Textbox/Header/Footer/Table, etc) and of course in top to bottom sequence?
Sandeep Gupta