Windows Vista Forums

Execute VBScript from a floating popup menu
  1. #1


    crashRCFlyer Guest

    Execute VBScript from a floating popup menu





    Please help, I am desperate!

    On my web html-php-mysql page, I use vbscript to execute method calls to an
    automation server (Dephi 7, apartment threaded, out-of-process)
    for a document imaging application. I can execute the methods via vbs fine
    when I use an html form element which has an event, such as onKeyDown,
    onClick, etc.

    I want to move some button functions to a popup menu I created using
    UltraMenu.

    For each menu item, UltraMenu provides a link input area to execute code
    corresponding to the corresponding menu item(s).

    I used this:

    http://localhost/resume3/vchrAdd.php?id=8. The "8" is an action flag to
    execute the above vbs script.


    In php:

    if ($action==8) {
    $scripter = new COM("MSScriptControl.ScriptControl");
    $scripter->Language = "vbscript";
    $k = $scripter->eval("UnBusyInvoice()"); <<-- both double and single
    quotes fail.
    print "Result: $k\n";
    $scripter = null;
    }

    This code throws an error:

    Fatal error: Uncaught exception 'com_exception' with message
    Source: Microsoft VBScript runtime error
    Description:Type mismatch: 'UnBusyInvoice'' in
    C:\wamp\www\resume3\vchrAdd.php:207
    Stack trace: #0
    C:\wamp\www\resume3\vchrAdd.php(207): com->eval('UnBusyInvoice()') #1 {main}
    thrown in
    C:\wamp\www\resume3\vchrAdd.php on line 207



    1. Is there a way to execute the subroutine in html, but use an action event
    that ALWAYS executes vs. onClick="vbso_Something()" which requires a person
    to do something?

    if ($action==8) {
    ?>

    -->>> enter html code to execute ( vbs:UnBusyInvoice() ) automatically
    w/o an onClick event

    <?
    }

    2. Or is there a cleaner way I can execute the vbs subroutine
    UnBusyInvoice() which resides in the <head></head> section.

    Some crazy html like:

    <input name="unBusyInv" id="unBusyInv" onAlwaysDoThis="vbs:UnBusyInvoice()"
    class="btn-filler-blue" value="UnBusy Invoice" type="text">




    Thanks much.

      My System SpecsSystem Spec

  2. #2


    crashRCFlyer Guest

    RE: Execute VBScript from a floating popup menu

    ADDENDUM:

    My vbscript is in the <head></head> section of the web page. The
    UnBusyInvoice subroutine follows:

    Sub UnBusyInvoice()
    Dim vDocID, vStatus, iResult
    vDocID = document.getElementByID("docID").value
    if not isobject(mySrvObj) then
    Set mySrvObj = parent.hidden.MasterSrvObj
    end if
    iResult = mySrvObj.UnBusyInvoice(vDocID, vStaus)
    if vStatus = 0 then
    document.getElementByID("docID").value = ""
    end if
    document.getElementByID("status1").value = vStaus
    End sub

      My System SpecsSystem Spec

Execute VBScript from a floating popup menu problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute dos cmds in the prompt opened using VBScript? AuHuman VB Script 4 01 Feb 2010
Execute vbscript using cscript.exe on remote machine using Powershell proxb PowerShell 12 04 Aug 2009
execute mysql query using vbscript James VB Script 0 09 Jun 2009
Applications do not execute from Desktop nor base Start Menu =?Utf-8?B?TGlnaHRmb290ZQ==?= Vista performance & maintenance 2 03 Jun 2007
displaying popup menu stack trace Ranj Avalon 1 28 Jun 2006