Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Reading word document in asp.net

Reading word document in asp.net

Scheduled Pinned Locked Moved C#
helpcsharpasp-netcom
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Spurple
    wrote on last edited by
    #1

    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);

    C 1 Reply Last reply
    0
    • S Spurple

      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);

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups