0
that’s the code I’m using
Set objShell = CreateObject("WScript.Shell")
set Window = CreateObject("InternetExplorer.Application")
Window.RegisterAsBrowser = True
Window.MenuBar = True
Window.ToolBar = True
Window.AddressBar = True
Window.StatusBar = True
Window.FullScreen = False
Window.Resizable = True
Window.Visible = True
Window.Width = 850
Window.Height = 720
Window.Navigate("www.microsoft.com")
wscript.sleep 5000
Window.Navigate2 "www.globo.com",navflags
'while 1<>2
if objShell.SendKeys "{ENTER}" then
wscript.sleep 2000
objShell.SendKeys "^{TAB}"
end if
'wend
Making a mistake in the if. Can someone tell me what I’m doing wrong?
I don’t think the Sendkey method returns anything to be used in the IF as you are doing. Remove the IF out which should work.
– cantoni
how do I run {TAB} only when clicking enter?
– marcio seixas
you need to capture the event that occurs when the user presses the enter key. Within this routine, you run the TAB. However, it is necessary to see if there is how to do this via VBS.
– cantoni