Problems Capturing activex events in HTAfiles using VBS ,,JS works

Discussion in 'HTML' started by mrrrhanson, Dec 19, 2007.

  1. mrrrhanson

    mrrrhanson Guest

    Hi.
    I was converting a file from JS to VBS and ran upon the problem of
    captureing events.

    The quik questions ..

    Can i capture activex events in an .hta file useing vbscript ...??
    Is JScript the only way to do this inside an .htm file?

    //////////////////////////////////
    <SCRIPT LANGUAGE="JavaScript">

    // Create the Sapi SpVoice object
    var VoiceObj = new ActiveXObject("Sapi.SpVoice");

    // lots of fun code

    // Handle EndStream Event
    function VoiceObj::EndStream() {
    idbSpeakText.value = "SpeakText";
    idImage.src = "mouthclo.bmp";
    }

    //// Events are captured and useable useing JScript.. but, i want to be able
    to use all VBscript
    //////////////////////////////////////////////

    '----
    My conversion of the 'fun code' to vbs is fine, but the events dont work
    '----
    <SCRIPT LANGUAGE="VBScript">

    Dim VoiceObj : Set VoiceObj = Createobject("Sapi.SpVoice") ' this cannot
    find server.. thus no events

    '// Handle EndStream Event
    Sub VoiceObj_EndStream()
    idbSpeakText.value = "SpeakText"
    idImage.src = "mouthclo.bmp"
    End Sub

    '-- then i tried

    Dim WithEvents
    Set VoiceObj = CreateObject("Sapi.SpVoice")
    ' this dont do it.. no events

    '--
    i cannt use this one cuz it needs WScript object (but it works fine in a
    xxxx.vbs file
    Set VoiceObj = WScript.CreateObject("VoiceObj","VoiceObj_")

    i have adjusted and tinkered all the code .... and must be missing
    something.
    is a Type library the answer..? i have'nt checked on these yet..
     
    mrrrhanson, Dec 19, 2007
    #1
    1. Advertising

  2. mrrrhanson

    Bergamot Guest

    Re: Problems Capturing activex events in HTAfiles using VBS ,,JSworks

    mrrrhanson wrote:
    >
    > I was converting a file from JS to VBS and ran upon the problem of
    > captureing events.


    If you choose to use VBScript, you obviously aren't doing anything for a
    publicly accessible web site since VBS is a Windows IE only thing. I
    suggest you ask Microsoft what's wrong with, or how to use/program,
    their stuff.
    microsoft.public.pick-a-better-newsgroup-than-alt-html

    In the event you are supposed to be doing something for a publicly
    accessible web site, stick with JS.
    comp.lang.javascript is over there ->

    --
    Berg
     
    Bergamot, Dec 20, 2007
    #2
    1. Advertising

  3. mrrrhanson

    mrrrhanson Guest

    "Bergamot" <> wrote in message
    news:...
    > mrrrhanson wrote:
    >>
    >> I was converting a file from JS to VBS and ran upon the problem of
    >> captureing events.

    >
    > If you choose to use VBScript, you obviously aren't doing anything for a
    > publicly accessible web site since VBS is a Windows IE only thing. I
    > suggest you ask Microsoft what's wrong with, or how to use/program,
    > their stuff.
    > microsoft.public.pick-a-better-newsgroup-than-alt-html
    >
    > In the event you are supposed to be doing something for a publicly
    > accessible web site, stick with JS.
    > comp.lang.javascript is over there ->
    >
    > --
    > Berg

    Thanks for the info ,,
    This is for my own learning experiance.
    i did figure that js is more common cuz that seems the common language in
    pages,
    and dont seem to popup the active X warnings.
    I asked here cuz i thought maybe someone may have experianced the the
    problem.. :)
    and will probly use/learn more JS.
    -- Morris
     
    mrrrhanson, Dec 21, 2007
    #3
    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. Lucas Tam
    Replies:
    1
    Views:
    742
    John Saunders
    Aug 17, 2003
  2. Replies:
    0
    Views:
    887
  3. vml
    Replies:
    0
    Views:
    1,047
  4. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    375
    Chris
    Aug 30, 2005
  5. San Diego Guy

    ASP not working, but same code in VBS works

    San Diego Guy, Jan 22, 2006, in forum: ASP General
    Replies:
    0
    Views:
    162
    San Diego Guy
    Jan 22, 2006
Loading...

Share This Page