Results 1 to 1 of 1
  1. #1
    Join Date
    Oct 2007
    Posts
    1

    Unanswered: MS Applications calling using javascripts

    Hi All
    I am using javascript for calling MS applications using activexobject. Below giving the codes

    <script language="JScript">
    function openWord()
    {

    var objShell = new ActiveXObject("WScript.Shell");
    var objWord = new ActiveXObject("Word.Application");
    var objDoc = objWord.Documents.Add();
    objWord.Visible = true;
    objShell.AppActivate("Document1");

    }

    }

    function openExcel()
    {

    var myApp = new ActiveXObject("Excel.Application");
    if (myApp != null)
    {
    myApp.visible = true;
    var Book = myApp.Workbooks.Add();
    myApp.workbooks.open("Book1.xls");

    }
    }

    function openPPT()
    {

    var myApp = new ActiveXObject("PowerPoint.Application");
    if (myApp != null)
    {
    myApp.Visible = true;
    myApp.Presentations.Add();
    myApp.Presentations.Open("Presentation1.ppt");
    }


    }

    function openOutlook()
    {
    var ws = new ActiveXObject("WScript.Shell");
    ws.run("outlook");
    }
    </script>

    I want to call other applications like openoffice.org writer (Sun's office application), ms paint, notepad etc...
    If anybody know its codes please send me and will be appreciated
    [email address removed - this is a public forum!]


    thanks and regards
    Sajith P
    Last edited by gvee; 10-08-07 at 11:24.

Posting Permissions

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