title: Read from word document line by line
body: <p><br>
  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 <strong>line by line</strong> and <strong>store in a list and bind to a gridview</strong>. Currently my code returns a list of one item only with all text (not line by line as desired). I'm using the <strong>Microsoft.Office.Interop.Word</strong> library to read the file. Below is my code till now:</p>
  
  <pre><code>    Application word = new Application();
      Document doc = new Document();
  
      object fileName = path;
      // Define an object to pass to the API for missing parameters
      object missing = System.Type.Missing;
      doc = word.Documents.Open(ref fileName,
              ref missing, ref missing, ref missing, ref missing,
              ref missing, ref missing, ref missing, ref missing,
              ref missing, ref missing, ref missing, ref missing,
              ref missing, ref missing, ref missing);
  
      String read = string.Empty;
      List&lt;string&gt; data = new List&lt;string&gt;();
      foreach (Range tmpRange in doc.StoryRanges)
      {
          //read += tmpRange.Text + "&lt;br&gt;";
          data.Add(tmpRange.Text);
      }
      ((_Document)doc).Close();
      ((_Application)word).Quit();
  
      GridView1.DataSource = data;
      GridView1.DataBind();
  </code></pre>