Here is my code written:-
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run " "
WScript.Sleep 5000
for i=1 to 20
WshShell.SendKeys "^{HOME}"
WshShell.SendKeys "{END}"
WScript.Sleep 50
WshShell.SendKeys " or "
WScript.Sleep 50
WshShell.SendKeys "{DELETE}"
WshShell.SendKeys "{END}"
next
Result of this code basically add's "or" onto any active window! This was written to help me in adding the text "or" in between two values. I run this code and place a notepad as active window which has values. but if i click and open any other window, this code continues untill " i = 20 " but i have to exit from this code if user("I") clicks on "Esc" button. Can somebody provide me solution to it.
I know there is wshShell.Quit....and i truely dont know how to use it!!
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run " "
WScript.Sleep 5000
for i=1 to 20
WshShell.SendKeys "^{HOME}"
WshShell.SendKeys "{END}"
WScript.Sleep 50
WshShell.SendKeys " or "
WScript.Sleep 50
WshShell.SendKeys "{DELETE}"
WshShell.SendKeys "{END}"
next
Result of this code basically add's "or" onto any active window! This was written to help me in adding the text "or" in between two values. I run this code and place a notepad as active window which has values. but if i click and open any other window, this code continues untill " i = 20 " but i have to exit from this code if user("I") clicks on "Esc" button. Can somebody provide me solution to it.
I know there is wshShell.Quit....and i truely dont know how to use it!!