SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Mar 2001
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I need to have a way to create a link that opens a specific word document.

    How can I write a javascript function to do that?

    thanks

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why don't you just link directly to the document itself?
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why don't you just link directly to the document itself?

    You are never going to be able to control the way a document is handled on a users computer.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  4. #4
    Irritability Defined
    Join Date
    Jul 2000
    Location
    80,000 feet below the surface
    Posts
    1,442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    JavaScript doesn't have the capacity to open external applications (and besides why use JScript when you can use HTML instead?)

    As Creole said, you just simply link to the word document. However, due to everyone's different computer software configurations you won't be able to control how the word document is opened.
    My 2 Cents (or is that 2.2 Cents including GST?)

  5. #5
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All what's been said has been correct. However, you can open up an application (although it asks the user for permission and alerts them because of the script needed for it). Take a look to see what I mean:

    <script language="Javascript">
    <!--//
    function runIt(prog) {
    if (document.all) {
    var wsh=new ActiveXObject("WScript.Shell");
    if (wsh) {wsh.Run(prog)}
    }
    else if ((navigator.appName.indexOf("Netscape")!=-1) && navigator.javaEnabled()) {
    netscape.security.PrivilegeManager.enablePrivilege("UniversalExecAccess");
    java.lang.Runtime.getRuntime().exec(prog)
    }
    }
    //-->
    </script>

    For example, to open Notepad:
    runIt("notepad")
    MSN Messenger:
    runIt("msmsgs")


    I don't know and couldn't figure out how to open MS Word, though, but why do you need ms word in the regular window and why not just in a browser window?

    aDog

  6. #6
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    northern Maine
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can see the thread here:
    http://forums.devshed.com/showthread...2590&forumid=3

    Which I assume was posted by the same person. Opening Word with a file loaded into it was also discussed there.
    Jason - Contact Me
    Supermoderator @ CodingForums

  7. #7
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanx jkd!!

    aDog


Bookmarks

Posting Permissions

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