Results 1 to 2 of 2

Thread: [2005] open word document in asp.net webform

  1. #1
    Fanatic Member vishalmarya's Avatar
    Join Date
    Feb 01
    Location
    New Delhi , INDIA
    Posts
    857

    [2005] open word document in asp.net webform

    i want to open a word document as readonly in asp.net webform

    i am using the below code. but an error is generated

    Dim ObjOffice As New Word.Application
    ObjOffice.Documents.Open(FileName, , True, , , , , , , , , True)
    ObjOffice.Activate()


    error - "Cannot activate application"

    how to go about it.
    Vishal Marya, MCP .net 3.5
    My Site
    http://www.vstoolsgallery.com/
    http://visualstudiogallery.msdn.micr...b-f87a909b9266





    Please indicate what version of vb you use.
    Please mark your thread resolved using the Thread Tools above.
    -----------------------------------------

  2. #2
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 02
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    Re: [2005] open word document in asp.net webform

    That code will attempt to open the word document in-memory on the server, not on the browser. You need to display the doc file on the client's machine. To do this, set up an IFRAME or frame on your page and set the source of the IFRAME/frame to be the location of the DOC file (http location of course). If the user's browser has the plugins to read the DOC file, it'll be displayed in the browser, else they will be prompted for a download.

    In either case, any changes they make to the doc file will be local to them and will not be saved back to the server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •