Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Execute VBScript from a floating popup menu

Reply
 
Old 08-29-2008   #1 (permalink)
crashRCFlyer


 
 

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
Old 08-29-2008   #2 (permalink)
crashRCFlyer


 
 

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
Reply

Thread Tools


Similar Threads
Thread Forum
Execute vbscript using cscript.exe on remote machine using Powershell PowerShell
execute mysql query using vbscript VB Script
Applications do not execute from Desktop nor base Start Menu Vista performance & maintenance
Applications do not execute from Desktop or base Start Menu Vista account administration


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46