I'm Looking for how to open multiple tabs in Internet Explorer with a vbscript? any idea? I can do it with separate windows but not with tabs ?
I show you what i did so far :
VBScript Code
Double-click the code block to select all.Option Explicit Dim Titre,MyLogin,MyPassword,IE MyLogin = "Hackoo" If CheckConnectionInternet() = True Then '**************************************************** 'Connexion au site DVP Titre = "Connexion vers le site developpez.net" Call Boite2Saisie(Titre,MyLogin,MyPassword) Call ConnexionDVP(MyLogin,MyPassword) '**************************************************** 'Connexion au site SFR Titre = "Connexion vers le site sfr.fr" Call Boite2Saisie(Titre,MyLogin,MyPassword) Call ConnexionSFR(MyLogin,MyPassword) '**************************************************** 'Connexion au Gmail Titre = "Connexion vers le site Gmail" Call Boite2Saisie(Titre,MyLogin,MyPassword) Call ConnexionGmail(MyLogin,MyPassword) '**************************************************** 'Connexion au Yahoo Mail Titre = "Connexion vers le site Yahoo Mail" Call Boite2Saisie(Titre,MyLogin,MyPassword) Call ConnexionYahooMail(MyLogin,MyPassword) End if '**************************************************** Function Boite2Saisie(Titre,MyLogin,MyPassword) Dim objIE,WS,ScreenWidth,ScreenHeight Set WS = CreateObject("Wscript.Shell") Set objIE = CreateObject("InternetExplorer.Application") objIE.Navigate "about:blank" objIE.Document.Title = Titre & String(20,"*") objIE.ToolBar = False objIE.Resizable = False objIE.StatusBar = False objIE.Width = 380 objIE.Height = 220 ScreenWidth = objIE.document.ParentWindow.screen.width ScreenHeight = objIE.document.ParentWindow.screen.height objIE.Left = (ScreenWidth - objIE.Width ) \ 2 objIE.Top = (ScreenHeight - objIE.Height) \ 2 Do While objIE.Busy WScript.Sleep 200 Loop objIE.Document.Body.InnerHTML = "<div align=""center""><p>Nom Utilisateur "_ & "<br><input type=""text"" size=""20"" "_ & "id=""Login"" value="& MyLogin &"></p>"_ & "</p><p>Mot de passe<br><input type=""password"" size=""20"" "_ & "id=""Password""></p><p><input type=" _ & """hidden"" id=""OK"" name=""OK"" value=""0"">"_ & "<input type=""submit"" value="" Connexion "" "_ & "onclick=""VBScript:OK.Value=1""></p></div>" objIE.Document.Body.Style.overflow = "auto" objIE.Document.body.style.backgroundcolor="lightblue" objIE.Visible = True objIE.Document.All.Password.Focus On Error Resume Next Do While objIE.Document.All.OK.Value = 0 WScript.Sleep 200 If Err Then IELogin = Array("","") objIE.Quit Set objIE = Nothing wscript.quit End if Loop On Error Goto 0 MyLogin = objIE.Document.All.Login.Value MyPassword = objIE.Document.All.Password.Value objIE.Quit If MyPassword = "" Then Wscript.Quit End Function '******************************************************************************************************************** Sub ConnexionDVP(MyLogin,MyPassword) Dim IE,Helem Set IE = CreateObject("InternetExplorer.Application") with IE .navigate "http://www.developpez.net/forums/login.php" .AddressBar = 1 .Visible = 1 .ToolBar = 1 .StatusBar = 1 Do While (.Busy) WScript.Sleep 100 Loop Set Helem = .document.getElementById("vb_login_username") Helem.Value = MyLogin Set Helem = .document.getElementById("vb_login_password") Helem.Value = MyPassword Set Helem = .document.Forms(1) Helem.Submit End with End Sub '******************************************************************************************************************** Sub ConnexionSFR(MyLogin,MyPassword) Dim IE,Helem Set IE = CreateObject("InternetExplorer.Application") with IE .AddressBar = 1 .Visible = 1 .ToolBar = 1 .StatusBar = 1 .navigate2 "https://www.sfr.fr/cas/login?service=ht ... =X_head_ec" Do While (.Busy) WScript.Sleep 100 Loop Set Helem = .document.getElementById("username") Helem.Value = MyLogin Set Helem = .document.getElementById("password") Helem.Value = MyPassword Set Helem = .document.Forms(1) Helem.Submit End with End Sub '******************************************************************************************************************** Sub ConnexionGmail(MyLogin,MyPassword) Dim IE,Helem Set IE = CreateObject("InternetExplorer.Application") with IE .navigate "https://accounts.google.com/ServiceLogi ... ail/&hl=fr" .AddressBar = 1 .Visible = 1 .ToolBar = 1 .StatusBar = 1 Do While (.Busy) WScript.Sleep 100 Loop Set Helem = .document.getElementById("Email") Helem.Value = MyLogin Set Helem = .document.getElementById("Passwd") Helem.Value = MyPassword Set Helem = .document.Forms(0) Helem.Submit End with End Sub '******************************************************************************************************************** Sub ConnexionYahooMail(MyLogin,MyPassword) Dim IE,Helem,objElement Set IE = CreateObject("InternetExplorer.Application") with IE .navigate "https://login.yahoo.com/config/login_ve ... fr&.src=ym" .AddressBar = 1 .Visible = 1 .ToolBar = 1 .StatusBar = 1 Do While (.Busy) WScript.Sleep 100 Loop Set Helem = .document.getElementById("username") Helem.Value = MyLogin Set Helem = .document.getElementById("passwd") Helem.Value = MyPassword For Each objElement In IE.Document.Forms("login_form").Elements If (LCase(objElement.Type) = "submit") Then objElement.Click Exit For End If Next End with End Sub '******************************************************************************************************************** Function CheckConnectionInternet() Dim Boucle,strComputer,MsgTitre,objPing,objStatus,ws Set ws = CreateObject("wscript.Shell") Boucle = True While Boucle = True strComputer = "smtp.gmail.com" MsgTitre = "TEST DE CONNEXION INTERNET ET SMTP DE GMAIL" Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}!\\").ExecQuery("select * from Win32_PingStatus where address = '" & strComputer & "'") For Each objStatus in objPing If objStatus.Statuscode = 0 Then 'Ws.popup "TEST SMTP DE GMAIL EST OK . VOUS ETES CONNECTE A INTERNET ET LE SMTP DE GMAIL EST DISPONIBLE !","3",MsgTitre,64 Boucle = False CheckConnectionInternet = True Exit Function else ws.popup "TEST SMTP DE GMAIL EST NO OK . VOUS N'ETES PAS CONNECTE A INTERNET ET LE SMTP DE GMAIL N'EST PLUS DISPONIBLE EN CE MOMENT !","3",MsgTitre,16 End If Next wscript.sleep 60000 Wend End Function '*******************************************************************