|
|
|
VbScriptXtra Reference/CreateObject()
|  |
|
 |
|
|
|
 |
 |
 |
 |
 |
 |
 |
xtra "VbScriptXtra".CreateObject(strProgId)
Syntax |
objAuto=CreateObject(xtra"VbScriptXtra",strProgId)
or
objAuto=xtra("VbScriptXtra").CreateObject(strProgId)
|
Parameters |
strProgId - a string specifying which object to create. For a list of possible ProgIds see FAQ section.
|
Returns |
Object: if successful, returns new VbScriptXtra wrapper instance for newly created automation object ProgId.
String: if failed, returns string with error description.
|
Description |
This method is an analogue to Visual Basic's CreateObject. It is used to create new automation objects. Therefore, it is a main entry point while using VbScriptXtra.
Every creatable automation object defines its own progId. For example, use:
"Word.Application" to run Microsoft Word.
|
Sample |
on navigate
-- Creating a new instance of Internet Explorer
ie=CreateObject(xtra"VbScriptXtra","InternetExplorer.Application")
-- Navigate to URL
ie.navigate("www.XtraMania.com")
-- ie is hidden now, making it fullscreen
ie.fullscreen=true
-- hiding extra interface elements
ie.menubar=false
ie.toolbar=false
ie.statusbar=false
-- Waiting while page is complete
repeat while ie.busy
put "Waiting for IE"
end repeat
-- Here we are, ready and fullscreen!
ie.visible=true
put "Ops!"
end
|
|
 |
 |
|
 |
 |
 |
 |
|
|
 |
|
|
|
|