| Creates a COM object. |
|---|
|
CreateObject(strProgID, strPrefix): Objects created with the CreateObject method using the strPrefix argument are connected objects. These are useful when you want to sync an object's events. The object's outgoing interface is connected to the script file after the object is created. Event functions are a combination of this prefix and the event name.
// File: create_object.w_js (JScript) var oIE = System.CreateObject("InternetExplorer.Application","EventIE_"); oIE.Toolbar = 0; // Show the "blank" page oIE.navigate("about:blank"); oIE.Visible = 1; function EventIE_OnQuit() { Window.Delete(1); Window.TextOut(1, 50, 50, "EventIE_OnQuit"); Window.UpdateWindow(); }; 'VBScript
Dim oIE
Set oIE = System.CreateObject("InternetExplorer.Application", "EventIE_")
oIE.Toolbar = 0
'Show the "blank" page
oIE.navigate("about:blank")
oIE.Visible = 1
Function EventIE_OnQuit()
Window.Delete 1
Window.TextOut 1, 50, 50, "EventIE_OnQuit"
Window.UpdateWindow
End Function
Notes: You can create the COM object without the event sinks.
|
| The advanced scripting shell. It is not wscript.exe! |