Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 28, 2013 09:18 AM by Darsh_basha
0 Points
1 Post
Feb 28, 2013 09:18 AM|LINK
Hi i want to display the word document with the same style in web page , and i tried this function
private void readFileContent(string path ) { 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); }
but this display the text without style
Darsh_basha
0 Points
1 Post
Open word file with same style
Feb 28, 2013 09:18 AM|LINK
Hi
i want to display the word document with the same style in web page , and i tried this function
private void readFileContent(string path ) { 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); }but this display the text without style