Web Analytics Made Easy -
StatCounter how to bring File Open dialog window from javascript code - CodingForum

Announcement

Collapse
No announcement yet.

how to bring File Open dialog window from javascript code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to bring File Open dialog window from javascript code

    Hi.
    i am trying to get the FileOpen dialogue prompt window as soon as clicked href link on jsp page.
    I am using IE6. My system is not supporting ActiveX object. how to enable it and opening MS application document.
    Just need to get the File Open dialogue window when i click on the HREF links.It would be great , if i know how to create the dynamic HREF links like it should be getting different document based on each userid.

    Here is my part of code for your ref:

    <table align="left" BORDER="0" CELLSPACING="1" cellpadding="0" COLS="1" WIDTH="170" id="TABLE1">
    <!-- View Profile menu is visible for all roles -->
    <tr><td colspan=2 class="leftMenu" height="20" onmouseover="javascript:showPartner()"><A class=leftMenu href="/dash/status.jsp" > Content Status</A></td></tr>




    <tr><td colspan=2 class="leftMenu" height="20" onmouseover="javascript:showPartner()"><A class=leftMenu href="# " onClick="startWord('User Guide.doc')"> User Guide</A></td></tr>

    <tr><td colspan=2 class="leftMenu" height="20" onmouseover="javascript:showPartner()"><A class=leftMenu href="#" onClick="startWord('User Guide 0.3.doc')"> Content Guidelines</A></td></tr>

    <tr><td colspan=2 class="leftMenu" height="20" onmouseover="javascript:showPartner()"><A class=leftMenu href="#" onclick="startPowerPoint('process.ppt')"> QA Guidelines</A></td></tr>


    <tr><td colspan=2 class="leftMenu" height="20" onmouseover="javascript:showPartner()"><A class=leftMenu href="#" onClick="startXL(Template.xls')"> Meta data template</A></td></tr>

    <tr><td colspan=2 class="leftMenu" height="20" onmouseover="javascript:showPartner()"><A class=leftMenu href="/dash/logout.jsp"> LogOut</A></td></tr>

    <!-- Blue continuation block menu-->
    <tr><td bgcolor="#333366" height=405 onmouseover="javascript:hideAll()"></td></tr>
    </table>



    <script language="JavaScript">
    function startXL(strFile)
    {
    var myApp = new ActiveXObject("Excel.Application");
    if (myApp != null)
    {
    myApp.visible = true;
    myApp.workbooks.open(strFile);
    }
    return false
    }
    function startWord(strFile)
    {
    var w=new ActiveXObject('Word.Application');
    var docText;
    var obj;
    if (w != null)
    {
    w.Visible = true;
    obj=w.Documents.Open(strFile);
    }
    return false;
    }
    function startPowerPoint(strFile)
    {
    var pause = 0;
    var wdDialogFileOpen = 80;
    var myApp = new ActiveXObject("PowerPoint.Application");
    //var dialog = myApp.Dialogs(wdDialogFileOpen);
    //var button = dialog.Show(pause);
    //alert(button);
    if (myApp != null)
    {
    myApp.Visible = true;
    myApp.Presentations.Open(strFile);
    }
    }
    /*function MakeDialog() {
    var newWindow = window.open("docs/Prisa Content Metadata Template.xls",
    "itsname", "chrome");
    }*/
    </script>
    </body>
    </html>

    Plz provide me the solution how to get the File Open dialogue prompt window from HREF links and how to enable ActiveX object to make this stmt works: var myApp = new ActiveXObject("PowerPoint.Application");

    Thanks in advance
    Waiting for your valuable reply asap
    regards
    venki
Working...
X