Opening Word Documents

Discussion in 'ASP .Net' started by dew, Feb 7, 2006.

  1. dew

    dew Guest

    How do I open a word document programmatically from a button, (1) with no
    Word prompts such as Save As, and (2) have it jump to a bookmark.

    I have tried two ways: at the btnShowDocument_click event, I do the
    following. This doesn't work at all, the document doesn't open, and I get a
    prompt that says "This document contains one or more links to other files.
    Do you want to update this document with the data from the linked files?" I
    do have linked files, but I don't want the users to have to deal with that.

    Try
    Response.ContentType = "Application/msword"
    Response.WriteFile("Help.doc")
    Catch
    Response.ContentType = "text/HTML"
    Response.Write("Document not found")
    Finally
    Response.End()
    End Try

    The second way is from a menu, with the script
    Script="window.open('Help.doc')"
    ClientScripts="onclick:window.open('Help.doc'). This one at least opens the
    document, but it still prompts them to update the links, and every time they
    click on a link in the table of contents, it asks them if they want to save
    changes -- what's that all about. And of course when they close it again
    asks them if they want to save changes. I don't want all these prompts.

    Thanks very much for your help.
     
    dew, Feb 7, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stephen Witter

    opening a word doc in word not browser

    Stephen Witter, May 18, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    524
    Stephen Witter
    May 18, 2004
  2. =?Utf-8?B?TWFyaw==?=

    opening and saving word documents in asp.net

    =?Utf-8?B?TWFyaw==?=, Aug 20, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    597
    =?Utf-8?B?TWFyaw==?=
    Aug 20, 2004
  3. =?Utf-8?B?cmljaGk=?=
    Replies:
    3
    Views:
    3,531
    =?Utf-8?B?cmljaGk=?=
    Nov 18, 2004
  4. Replies:
    1
    Views:
    517
    Juan T. Llibre
    Oct 18, 2006
  5. Tony
    Replies:
    2
    Views:
    425
Loading...

Share This Page