WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with MSIE
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Fire a ONMOUSEOVER MSIE Event via Ole


With MSIE and OLE you can trigger events on a page in some circumstances. The first cell in the first table has the ONMOUSEOVER & ONMOUSEOUT events set so that if the mouse is passed over it, the cell will turn lightblue and then turn white when the mouse leaves.

This script will load the page then trigger the two events programmatically. Once it exits you can test it by hand.

You might be able to trigger the ONMOUSEOVER event for a portion of any page you're interested in and not have to bother with MOUSEPLAY (which I found doesn't work on certain pages).

Compliments of Jay Alverson.

FireEvent.wbt

   url = "C:\Test\Stan\FireEventSample.html"  ;<--- change path to your file...
   Browser = ObjectOpen("InternetExplorer.Application")
   Browser.addressbar = @TRUE
   Browser.statusbar = @TRUE
   Browser.menubar = @TRUE
   Browser.toolbar = @TRUE
   browser.visible = @TRUE
   browser.navigate(url)
   While browser.busy || browser.readystate <> 4
      TimeDelay(0.5)
   EndWhile
;
   browserdoc = browser.Document
   all = browserdoc.all
   browserdoc.title = "Winbatch Fire Element Test"
;
;   get table cell...
   TestTD = all.item("FE")
   Display(2, "MSIE OLE", "Watch Table Cell...")
   TestTD.FireEvent("onmouseover")  ;<--- fire the named event...
   TimeDelay(3)
   TestTD.FireEvent("onmouseout")   ;<--- fire the named event...

;   
   TimeDelay(3)
;   browser.quit
   ObjectClose(TestTD)
   ObjectClose(all)
   ObjectClose(browserdoc)
   ObjectClose(browser)
FireEventSample.html
	<html>
	<!--This is the Sample 2 HTML for the Winbatch MSIE OLE Example-->
	<head>
		<title>Winbatch Fire Event Sample</title>
	</head>
	<body>
	   <center>
			<h1>Sample Table Data</h1>
			<h2>Testing Fire Event Method via Winbatch</h2>
			<br>
			<table id="SampleTable1" border="1">
			<caption><b>EXE File Information</b></caption>
			<tr>
			<th>File Name</th><th>File Size</th><th>File Date</th>
			</tr>
			<tr>
			<td id="FE" onmouseover="this.style.backgroundColor='powderblue'" onmouseout="this.style.backgroundColor='white'">WBCompiler.exe</td><td>253 KB</td><td>3/16/03</td>
			</tr>
			<tr>
			<td>popmenu.exe</td><td>96 KB</td><td>3/16/03</td>
			</tr>
			<tr>
			<td>WinBatch.exe</td><td>105 KB</td><td>3/18/03</td>
			</tr>
			</table>
			<br><br>
			<table id="SampleTable2" border="1">
			<caption><b>DLL File Information</b></caption>
			<tr>
			<th>File Name</th><th>File Size</th><th>File Date</th>
			</tr>
			<tr>
			<td>filemenu.dll</td><td>32 KB</td><td>3/16/03</td>
			</tr>
			<tr>
			<td>RoboScrp.dll</td><td>120 KB</td><td>3/16/03</td>
			</tr>
			<tr>
			<td>winmacro.dll</td><td>328 KB</td><td>3/18/03</td>
			</tr>
			<tr>
			<td>witzsrch.dll</td><td>17 KB</td><td>3/18/03</td>
			</tr>
			</table>
	   </center>
	</body>
	</html>

Article ID:   W16118
File Created: 2005:07:13:08:27:22
Last Updated: 2005:07:13:08:27:22