
Originally Posted by
robbs
Just assume i have already opened Internet explorer-Yahoomail.com Window on my desktop , on that already opend FOREGROUNDED Window i want to send following keystrokes just by pressing CTRL + H.
(1)Tab
(2)ABCD
(3)Tab
(4)1234 AND THEN AGAIN CTRL + H ...........UPTO 1000 times
CONDITIONS : I CAN NOT SWITCHOVER TO EXCEL MACRO BY ALT+TAB OR MOUSE(To activate that macro) AND I NEED TO PERFORM THIS CTRL + H TASK REPEATEDLY ON THE SAME WINDOW WITHOUT SWITCHOVER TO ANY OTHER WINDOW.
If not Sendkey then anything else you will suggest?The basic requirement is sending some FIXED keystrokes one after another by pressing CTRL+H on a particular application REPEATEDLY.Any thing in Windows itself available so that whenever i press CTRL + H, IT WILL SEND some keystrokes.
Thank you.
Regards
Robs
Assigning a "Hotkey" to CTRL+H is a function that is available in windows and should not be a problem once you write the script and assign it the hotkey of your choice. SendKey is also an easy script to write, the problem will come in when SendKey fails, is not focused on the right item/screen and continues on it's merry way and you got a huge mess on your hands (especially if you are planning to run this for 1000 items/instances). The suggested method would be to use the InternetExplorer.Application approach and find out the names of the fields you are entering the information into and write a script that is not going to cause you more headaches in the end. After you figure out what/how to run this properly then you can implement a Loop to run it the amount of times you need to.
Example:
Code:
Dim objIE : Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = True
objIE.Navigate "https://login.yahoo.com/config/login_verify2?&.src=ym"
Do Until objIE.ReadyState = 4
WScript.Sleep 500
Loop
objIE.Document.All.Item("username").Value = "me@yahoo.com"
objIE.Document.All.Item("passwd").Value = "Th!s!sMyP@ssW@rd"
objIE.Document.All.Item("persistent").checked = True
P.S. The above is only an example. Don't use this script to login since it will keep your password in plain text