I\'m trying to read a word document using C#. I am able to get all text but I want to be able to read line by line and store in a list and bind
The above code is correct, but it's too slow. I have improved the code, and it's much faster than the above one.
List data = new List();
Application app = new Application();
Document doc = app.Documents.Open(ref readFromPath);
foreach (Paragraph objParagraph in doc.Paragraphs)
data.Add(objParagraph.Range.Text.Trim());
((_Document)doc).Close();
((_Application)app).Quit();