1.11M Members

Word Document into webpage with same style

 
0
 

hi
i want to display word file with same style using asp.net c#

here is code that display word file content without images ,tables ,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);

any idea to display

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article