title: Reading text in word with Style/format using c#
body: <p>i am writing a c# code to open a word file using Application and Document object and want to read a document with its styling and formats example is given below:-
  i am able to getting text but not able to getting its styles and formats.</p>
  
  <pre><code>private void readFileContent(string path)
  {
      Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
      object file = path;
      object nullobj = System.Reflection.Missing.Value;
  
      Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Open(
          ref file, ref nullobj, ref nullobj,
          ref nullobj, ref nullobj, ref nullobj,
          ref nullobj, ref nullobj, ref nullobj,
          ref nullobj, ref nullobj, ref nullobj);
  
  
      doc.ActiveWindow.Selection.WholeStory();
      doc.ActiveWindow.Selection.Copy();
  
      IDataObject data = Clipboard.GetDataObject();
  
      string getdata = data.GetData(DataFormats.Text).ToString();
  
      doc.Close(ref nullobj, ref nullobj, ref nullobj);
      wordApp.Quit(ref nullobj, ref nullobj, ref nullobj);
  
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/2RCo4.png" alt="enter image description here"></p>