Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to open multiple tabs in Internet Explorer 1

Status
Not open for further replies.

bkoopers

IS-IT--Management
Apr 26, 2005
86
0
0
US
I need a script that will open multiple web pages in one window in Internet Explorer each in separate tabs with the last tab on the right being the active one. Can anyone please provide a VBScript or a batch file that can do that?

Thanks to anyone who can help me out.
 
Set objExplorer = CreateObject("InternetExplorer.Application")
WebSite = "with objExplorer
.Navigate2 WebSite
.AddressBar = 1
.Visible = 1
.ToolBar = 1
.StatusBar = 1
end with

WebSite = "with objExplorer
.Navigate2 WebSite, &h800
.AddressBar = 1
.Visible = 1
.ToolBar = 1
.StatusBar = 1
end with
 
mltoombs: Thank you very much for the solution. I tried it and it works!

Could you please refer me to a website that details the description of each command in this script? I found some VBScript command reference websites but nothing that details these Internet Explorer commands.
 
Hi [peace]
You can also try this code :

Code:
Option Explicit
Const NewTab = &h800
Dim objExplorer
Set objExplorer = CreateObject("InternetExplorer.Application")
If CheckConnectionInternet() = True Then Call Main()
'*****************************************************************
Sub Main()
	NavigateIE_Tabs "[URL unfurl="true"]http://tek-tips.com/viewthread.cfm?qid=1721921",""[/URL]
	NavigateIE_Tabs "[URL unfurl="true"]http://www.developpez.com",NewTab[/URL]
	NavigateIE_Tabs "[URL unfurl="true"]http://www.google.com",NewTab[/URL]
	NavigateIE_Tabs "[URL unfurl="true"]http://www.yahoo.com",NewTab[/URL]
	NavigateIE_Tabs "[URL unfurl="true"]https://www.facebook.com",NewTab[/URL]
	NavigateIE_Tabs "[URL unfurl="true"]http://bbat.forumeiro.com",NewTab[/URL]
End Sub
'*****************************************************************
Sub NavigateIE_Tabs(WebSite,Argum)
	with objExplorer
		If Argum = "" Then
'The user did not pass in a value for Argum
			.Navigate2 WebSite,Argum
			.AddressBar = 1
			.Visible = 1
			.ToolBar = 1
			.StatusBar = 1
		Else 
'The user passed in a value for Argum
			.Navigate2 WebSite,Argum
			.AddressBar = 1
			.Visible = 1
			.ToolBar = 1
			.StatusBar = 1
		End If
	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
'*******************************************************************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top