Detect ActiveX

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David C

    #1

    Detect ActiveX

    I have an ASP.Net page that displays documents as hyperlinks from a network
    folder (intranet application). I also have a column that contains a
    hyperlink to open the document in Microsoft Word. All works fine unless
    someone has ActiveX disabled on their browser. Is there any way I can
    detect that so I can give them a warning?

    The script for opening a Word document is below. Thanks.

    -David

    <script language="javas cript" type="text/javascript">

    function openWord(spath)
    {
    var pause = 0;
    var wdDialogFileOpe n = 80;
    var wdApp = new ActiveXObject(" Word.Applicatio n");
    wdApp.Visible = 'True';
    var wdDoc = wdApp.Documents ;
    wdDoc.Open(spat h);
    document.form1. submit();
    }

    </script>


  • Alexey Smirnov

    #2
    Re: Detect ActiveX

    On Nov 11, 7:06 pm, "David C" <dlch...@lifeti meinc.comwrote:
    I have an ASP.Net page that displays documents as hyperlinks from a network
    folder (intranet application). I also have a column that contains a
    hyperlink to open the document in Microsoft Word.  All works fine unless
    someone has ActiveX disabled on their browser.  Is there any way I can
    detect that so I can give them a warning?
    >
    The script for opening a Word document is below.  Thanks.
    >
    -David
    >
    <script language="javas cript" type="text/javascript">
    >
    function openWord(spath)
    {
        var pause = 0;
        var wdDialogFileOpe n = 80;
        var wdApp = new ActiveXObject(" Word.Applicatio n");
        wdApp.Visible = 'True';
        var wdDoc = wdApp.Documents ;
        wdDoc.Open(spat h);
        document.form1. submit();
    >
    }
    >
    </script>
    Hi David,

    I think you can simply add the try..catch block to check the result of
    ActiveXObject

    try {

    var wdApp = new ActiveXObject(" Word.Applicatio n");
    wdApp.Visible = 'True';
    var wdDoc = wdApp.Documents ;
    wdDoc.Open(spat h);
    document.form1. submit();

    } catch (er) {

    alert('You have no Word ActiveX');

    }


    Comment

    Working...