how do I create a function in vbs that by clicking the enter it alternates two windows ie alt + tab

0

This is 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

It is giving error in if. Can anyone tell me what I'm doing wrong?

    
asked by anonymous 02.08.2016 / 15:42

0 answers