Hi,

I'm writing a small vb script that will allow certain users to interact with
a few elements of our AD. I've got the AD interaction working, however one
of the features I'd like if for people to be able to select some options
from a drop down menu. Is this possible? I've read certain articles that say
vbscript/wsh doesn't support drop menus, but these were a few years old. Is
it still true? If so, does anyone have any recommendations for a way around
it?

Cheers

Ben

Re: Using Menus in WSH Scripting? by mayayana

mayayana
Thu Mar 16 09:59:26 CST 2006

There are two ways that I can think of:

1) Use an IE window without a frame
and build your menu as a webpage.
Some samples of the options available
are here:
http://www.jsware.net/jsware/scripts.php3#classpk

You can do most anything that way but you'll
need to know HTML (and maybe some CSS
if you want it to look nice). You could even use VBS
in the webpage to move and alter visibility of
hidden tables in order to simulate hover dropdowns.

2) If it only needs to be "for certain people" then
IEMENU.OCX might be an option. IE4 came with
several controls (OCX files) that could be used in
webpages. Apparently they were not very popular,
as Microsoft phased them out in later IE versions,
but you can still get IEMENU.OCX from a Win98
1st edition machine or CABs. As far as I know
there's no limitation about redistribution of the file.
Once you have IEMENU.OCX you can use an
invisible instance of IE to pop up a standard
Windows menu onscreen. Sample here:

http://www.jsware.net/jsware/scripts.php3#classpk

> Hi,
>
> I'm writing a small vb script that will allow certain users to interact
with
> a few elements of our AD. I've got the AD interaction working, however one
> of the features I'd like if for people to be able to select some options
> from a drop down menu. Is this possible? I've read certain articles that
say
> vbscript/wsh doesn't support drop menus, but these were a few years old.
Is
> it still true? If so, does anyone have any recommendations for a way
around
> it?
>
> Cheers
>
> Ben
>
>



Re: Using Menus in WSH Scripting? by McKirahan

McKirahan
Thu Mar 16 11:06:32 CST 2006

"Ben" <bjblackmore@mailhot.com> wrote in message
news:OKbkQIPSGHA.5656@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> I'm writing a small vb script that will allow certain users to interact
with
> a few elements of our AD. I've got the AD interaction working, however one
> of the features I'd like if for people to be able to select some options
> from a drop down menu. Is this possible? I've read certain articles that
say
> vbscript/wsh doesn't support drop menus, but these were a few years old.
Is
> it still true? If so, does anyone have any recommendations for a way
around
> it?

Look into HTML Applications. Here are some links:

Introduction to HTML Applications (HTAs)
<URL:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/overv
iew/htaoverview.asp>

HTML Applications
http://www.htmlgoodies.com/beyond/reference/article.php/3472841

It's basically a Web page but with an ".hta" extenstion.

Try this:

<html>
<head>
<title>sample.hta</title>
<HTA:Application ID = "HTA"
ApplicationName = "Sample">
<script type="text/vbscript">
Option Explicit
Sub Pick()
Dim intOPT
intOPT = document.form1.sel.selectedIndex
Dim strTXT
strTXT = document.form1.sel.options(intOPT).text
Dim strVAL
strVAL = document.form1.sel.options(intOPT).value
Alert("Selected: " & strVAL & " = " & strTXT)
End Sub
</script>
</head>
<body>
<form name="form1">
<b>Pick one:</b> &nbsp;
<select name="sel" onchange="Pick()">
<option value=""></option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
</form>
</body>
</html>