' Events.vbs ' Navigates to a Web site and waits for some IE events. '---------------------------------------------------------------------- Option Explicit Dim IE ' Create the IE object Set IE = WScript.CreateObject("InternetExplorer.Application", "Browser_") IE.Visible = True IE.Navigate "http://www.wrox.com" ' Loop until we close the browser... While IE.Visible Wend ' Here the browser is closed. Although technically unnecessary, let's tidy up WScript.DisconnectObject IE Set IE = Nothing '---------------------------------------------------------------------- ' Subroutines '---------------------------------------------------------------------- Sub Browser_DownloadBegin() WScript.Echo "Download begins at " & Now End Sub Sub Browser_DownloadComplete() WScript.Echo "Download completed at " & Now End Sub Sub Browser_DocumentComplete(pDisp, URL) Dim doc Set doc = IE.Document WScript.Echo doc.Title End Sub