little samie

sub SetListBoxItem { #$SelectName, $ItemName, [$formname]

Description: Sets an Item in a List Box.

How To:

Find the list box name in your html with View Source:

Example:

        <select name="Orgs" id="SearchBox">
		<option value="-1">All</option>
		<option value="12">Org1</option>
		<option value="69">Org2</option>
		<option value="49">Org3</option>
	</select>
If you want to select the Org3 item

SetListBoxItem("Orgs","49");

$formname is optional and is used when you have more than one listbox with the same name in different forms

Cookbook recipe
use Win32::OLE;
use Win32::SAM;
#use Win32::Slingshot;

$| = 1;
my $URL = "http://samie.sourceforge.net/listbox.html";
my $seconds;

$Win32::OLE::Warn = 3;

StartIE();
$seconds = Navigate($URL);
print "messagebox.html page took $seconds seconds to load\n";
SetListBoxItem("Orgs","49");
little samie