please help Display a.doc file in asp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • naveed1
    New Member
    • Mar 2007
    • 3

    please help Display a.doc file in asp

    i want to display a.doc file in asp page. please tell me are it is possible in via binaryread or any other method. am i display 1st page of doc file as image. please help in that
  • sani723
    New Member
    • Feb 2007
    • 117

    #2
    You can consider using the Office PIA (Primary Interop Assemblies), automate
    Word and open the document in it, and extract the relevant portions from the
    same, preserving the formatting.

    Comment

    • sani723
      New Member
      • Feb 2007
      • 117

      #3
      but in ASP u can access word or any file uisng File System Object as:

      dim fso
      dim wordfile

      set fso=Server.crea teObject("Scrip ting.FileSystem Object")

      wordfile= fso.opentextfil e(path).readall

      set fso=nothing

      Comment

      • pongscript
        New Member
        • Mar 2007
        • 27

        #4
        the procedure below would be invalid...
        this is because word are not a raw text format

        so the code below would return an unreadable string.


        dim fso
        dim wordfile

        set fso=Server.crea teObject("Scrip ting.FileSystem Object")

        wordfile= fso.opentextfil e(path).readall

        set fso=nothing

        Comment

        • padmakar
          New Member
          • Mar 2007
          • 14

          #5
          use an iframe and give src location to the doc file you want to display..

          Comment

          • pongscript
            New Member
            • Mar 2007
            • 27

            #6
            ahh... since you mean that the file was a in doc format... i agree with padmakar

            but make sure the mime type was set properly,, because if you use iframe improperly ... mostlikely ... it would envoke a download instead of displaying your document.

            Comment

            Working...