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
i want to display word file with same style using asp.net c#
The code you provided is missing a few steps (I don't you can used the code because it's not going to work).
Read this link (it has an example on how to show the .doc file):
http://www.c-sharpcorner.com/UploadFile/scottlysle/WordinWeb01202007101216AM/WordinWeb.aspx
or this:
http://www.aspsnippets.com/Articles/Display-Word-document-on-web-page-in-ASP.Net.aspx