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

2
Contributors
1
Reply
7
Views
3 Years
Discussion Span
Last Post by LastMitch
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.