mostafa mannsy

mostafa mannsy

  • NA
  • 1
  • 1.4k

how can display word document with same style in webpage

Feb 28 2013 6:36 AM
Hi 
i want to display word document with same style in the webpage 

goggled for this and found function display the content without  styles"  font size , tables , images ,etc....."

ApplicationClass wordApp = new ApplicationClass();

      object file = path;

      object nullobj = System.Reflection.Missing.Value;
      object format = true;

      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,
      ref nullobj,
      ref nullobj,
      ref nullobj,
      ref nullobj);



      doc.ActiveWindow.Selection.WholeStory();

      doc.ActiveWindow.Selection.Copy();

      string sFileText = doc.Content.Text;
      //string style = doc.

      doc.Close(ref nullobj, ref nullobj, ref nullobj);

      wordApp.Quit(ref nullobj, ref nullobj, ref nullobj);

      Response.Write(sFileText);