Reading word document in asp.net
-
hi all, Im trying to read word document in asp.net 1.1 with following code. added required ddls too.(i.e Microsoft Office 10.0 Object Library,Microsoft Word 11.0 Object Library) but it is throwing error {Access is denied} plz help! thanks in advance! Code: Microsoft.Office.Interop.Word.ApplicationClass obj_app=new Microsoft.Office.Interop.Word.ApplicationClass(); Microsoft.Office.Interop.Word.Document obj_doc=new Microsoft.Office.Interop.Word.Document(); object readOnly = false; object isVisible = true; object missing = System.Reflection.Missing.Value; object filepath=_FilePath; obj_doc=obj_app.Documents.Open(ref filepath, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing); obj_doc.Select(); string m_Content=""; m_Content=obj_app.Selection.FormattedText.Text; obj_doc.Close(ref missing,ref missing,ref missing); obj_app.Quit(ref missing, ref missing, ref missing); Response.Write(m_Content);
-
hi all, Im trying to read word document in asp.net 1.1 with following code. added required ddls too.(i.e Microsoft Office 10.0 Object Library,Microsoft Word 11.0 Object Library) but it is throwing error {Access is denied} plz help! thanks in advance! Code: Microsoft.Office.Interop.Word.ApplicationClass obj_app=new Microsoft.Office.Interop.Word.ApplicationClass(); Microsoft.Office.Interop.Word.Document obj_doc=new Microsoft.Office.Interop.Word.Document(); object readOnly = false; object isVisible = true; object missing = System.Reflection.Missing.Value; object filepath=_FilePath; obj_doc=obj_app.Documents.Open(ref filepath, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing); obj_doc.Select(); string m_Content=""; m_Content=obj_app.Selection.FormattedText.Text; obj_doc.Close(ref missing,ref missing,ref missing); obj_app.Quit(ref missing, ref missing, ref missing); Response.Write(m_Content);
A couple of things missing here 1 - why did you not ask in the ASP.NET forum 2 - what is the filepath ? 3 - why are you trying to read a word doc within an ASP.NET site ?
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp