All Forums >> [Scripting] >> Post a VBScript >> "InternetExplorer.Application" object example 1 Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
- i have a few friends that are unable to locate "InternetExplorer.Application" object examples - this is a simple example of using the IE object to open a page while controlling the window properties.
- if there are any questions let me know. - i will start posting other examples of mine for anyone who is curious about the IE object usage Cheers!
so initally i thought i would take it step by step on the IE object stuff... started to think, i just showed how to create a window and have it navigate. (not too useful by itself)
that being said, lets take a few jumps forward and attempt to automate a google search for starters.
in order to do this we will need to have a basic understanding of objects on a web page. (googles main page) - hopefully everyone here is somewhat familure with HTML source to know what we are looking for/at.
assuming you are using the previous script (IEGenerate) all we need to do is add a few more functions to the vbs and then call them.
ok so that all is kind of extensive, hope i noted well enough. **also may want to know that the google object names were pulled directly from the page source(q and btnG)**
on a side note if you actually take the time to read the code you will note some small but important calls - i have made sure that these functions are NOT case sensitive like javascript using LCASE calls - i have also noted in the ability for error checking (returning a true or false value on functions) - also if you wanted you could cut these up easily and add them together instead of making multiple functions and subs!
now using these you should have all you really need to automate web page logons as well, but incase not i will add some more handy functions/Subs soon...
next example (one of my favorites) i will post is more common for use with HTA's but i use in both VBS and HTA's and that is to generate a web page on the fly.
ok, so just as I did say here is how to create a HTML Page on the fly...
this is one of the most simplistic ideas ever made for gui format WITHOUT actually making a gui format, more common with HTA but it works with vbs great.
i am not sure if those of you who have attempted the previous code have noticed yet but the functions i have dropped here on the forum so far are basic web page design stuff, most of which are commonly used in Javascript. if you have not attemped to learn or read any, you may want to consider it once you are comfortable with VBS at a reading understanding level at least.
PS: - the functions shown previously have multiple uses, for instance the IEValueChange is able to modify the value property of almost any object you choose. try to read through the previous code and see what you can make sections do, you may find some uses you may not have thought of before and end up making some serious custom scripts.