vbs Script using msie as an object
-
I am attempting to write a script using ms ie as an object, and controlling a sequence of interactions with the site without having to physically move the mouse around and click and type into message boxes or select boxes. This is all from the client side, of course. So far, I have code that will alow me to open an explorer window at the selected http site and click on any button I want to. But I have not found a way to enter text, or select from a list box. Does anyone here know how to do this? I am beginning to think that it is not even possible after searching for hours on the net. Is there a way to simulate key presses? Where can I find a complete referance to the ie procedures? Russ
-
I am attempting to write a script using ms ie as an object, and controlling a sequence of interactions with the site without having to physically move the mouse around and click and type into message boxes or select boxes. This is all from the client side, of course. So far, I have code that will alow me to open an explorer window at the selected http site and click on any button I want to. But I have not found a way to enter text, or select from a list box. Does anyone here know how to do this? I am beginning to think that it is not even possible after searching for hours on the net. Is there a way to simulate key presses? Where can I find a complete referance to the ie procedures? Russ
When you tell the IE Object to Navigate to a web page, it will fire a DocumentComplete (I Think!) event to let you know that the enitre page has been retrieved. In your event handler, you can get a reference to the Document using something like this:
Dim objDocument as Document
Set objDocument = objIEBrowser.Document(Someone feel free to correct me if I'm wrong!) From there, you can use the Document object to find the control that you want in its Elements collection. You can then modify the text you want, then you call the Click method of the submit button, which you will also find in the Elements collection somewhere. You can find the complete document on the Document object model here[^]. RageInTheMachine9532