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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening a url from an HTA or VBS? 3

Status
Not open for further replies.

jfdabiri

MIS
Feb 27, 2007
282
US
hi,
is it possible to open a url from a vbs or an hta, to make it easier for the user? is it possible to contain this page of the url within the hta body?
thanks.
 
Yes it is. For a page in the hta you could look at iframe. If you're looking for a type of progress window you can do the same with an HTA or VBS:

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
You can use vbscript in either a VBS or HTA file to create an instance of IE and navigate to the desired URL.

Code:
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate2 "[URL unfurl="true"]http://www.thespidersparlor.com/vbscript"[/URL]
IE.Visible = True

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
thanks mark and dm.
my point is, not to create an instanc of ie and show the page there, but create a big box inside my own hta and show the url page in that box. maybe i'm not explaining it right.
 
Maybe like this?

Code:
<html>
<head>
<title>Test</title>
<HTA:APPLICATION
   Application ID = "Test"
   APPLICATIONNAME = "Test"
   BORDER = "DIALOG"
   BORDERSTYLE = "NORMAL"
   CAPTION = "YES"
   CONTEXTMENU = "YES"
   ICON = ""
   INNERBORDER = "YES"
   MAXIMIZEBUTTON = "YES"
   MINIMIZEBUTTON = "YES"
   NAVIGABLE = "NO"
   SCROLL = "AUTO"
   SCROLLFLAT = "NO"
   SELECTION = "NO"
   SHOWINTASKBAR = "YES"
   SINGLEINSTANCE = "NO"
   SYSMENU = "YES"
   VERSION = "1.0"
   WINDOWSTATE = "NORMAL"
   />
</head>
<SCRIPT Language="VBScript">
Sub GetURL
	document.getElementById("iwin").innerHTML = "<iframe width='600' height='500' src='[URL unfurl="true"]http://www.google.com'></iframe>"[/URL]
End Sub
</SCRIPT>
<body>
<input type="button" value="Get URL" onclick="GetURL">
<br><br>
<span id="iwin"></span>
</body>
</html>

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
dm,
that worked for a test. i have to give the user a list box and have them select a url to go to.
thanks again.
 
Code:
<html>
<head>
<title>Test</title>
<HTA:APPLICATION
   Application ID = "Test"
   APPLICATIONNAME = "Test"
   BORDER = "DIALOG"
   BORDERSTYLE = "NORMAL"
   CAPTION = "YES"
   CONTEXTMENU = "YES"
   ICON = ""
   INNERBORDER = "YES"
   MAXIMIZEBUTTON = "YES"
   MINIMIZEBUTTON = "YES"
   NAVIGABLE = "NO"
   SCROLL = "AUTO"
   SCROLLFLAT = "NO"
   SELECTION = "NO"
   SHOWINTASKBAR = "YES"
   SINGLEINSTANCE = "NO"
   SYSMENU = "YES"
   VERSION = "1.0"
   WINDOWSTATE = "NORMAL"
   />
</head>
<SCRIPT Language="VBScript">
Sub GoToURL
	Dim strURL  : strURL = window.document.getElementById("URLS").Value
	Dim strHTML : strHTML = "<iframe width='600' height='500' src='" & strURL & "'></iframe>"
	window.document.getElementById("iwin").innerHTML = strHTML
End Sub
</SCRIPT>
<body>
Select a site:&nbsp;
<select id="URLS">
	<option value="[URL unfurl="true"]http://www.google.com">Google</option>[/URL]
	<option value="[URL unfurl="true"]http://www.yahoo.com">Yahoo</option>[/URL]
</select>
&nbsp;<input type="button" value="Go To Page" onclick="GoToURL">
<br><br>
<span id="iwin"></span>
</body>
</html>

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Thanks Mark!

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Working with the example dm4ever provided, here is how you can do it with a drop down.

Code:
<html>
<head>
<title>Test</title>
<HTA:APPLICATION
   Application ID = "Test"
   APPLICATIONNAME = "Test"
   BORDER = "DIALOG"
   BORDERSTYLE = "NORMAL"
   CAPTION = "YES"
   CONTEXTMENU = "YES"
   ICON = ""
   INNERBORDER = "YES"
   MAXIMIZEBUTTON = "YES"
   MINIMIZEBUTTON = "YES"
   NAVIGABLE = "NO"
   SCROLL = "AUTO"
   SCROLLFLAT = "NO"
   SELECTION = "NO"
   SHOWINTASKBAR = "YES"
   SINGLEINSTANCE = "NO"
   SYSMENU = "YES"
   VERSION = "1.0"
   WINDOWSTATE = "NORMAL"
   />
</head>
<SCRIPT Language="VBScript">
Sub GetURL
	Dim thisURL
	thisURL = urldrop.value
    document.getElementById("noiwin").innerHTML = "<iframe width='800' height='500' src='" & thisURL & "'></iframe>"
End Sub
</SCRIPT>
<body>
<select name="urldrop" style="width: 200px" onchange="GetURL">
<option value="">Select URL</option>
<option value="[URL unfurl="true"]http://www.google.com">Google</option>[/URL]
<option value="[URL unfurl="true"]http://www.thespidersparlor.com/vbscript">The[/URL] Spider's Parlor</option>
</select>


<br><br>
<span id="noiwin"></span>
</body>
</html>

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
:) I was thinking of doing the onchange for the drop down, but decided on the button...now jfdabiri gets two options...this is what makes these forums great.

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
thanks so much guys. this really helps a lot. i appreciate it.
 
Mark,
Always working the angles. ;-)
Code:
<option value="[URL unfurl="true"]http://www.thespidersparlor.com/vbscript">The[/URL] Spider's Parlor</option>
 
Thanks all. This is great info.

I would like to see how you would provide a search string in the outer frame, and then click "Go To Page" and have the search string passed to the search string in the inner frame and click the appropriate search button.

Finally, could you extract some info (perhaps the first result) and save that information to a file?

Thanks
 
All-

That is truly a nice drop down choice.. Just for fun I tried it on my Firefox browser.. I did get the goodle and spiders parlor drop down but when I choose one of the two it doesn't actually go to the specific site.. just sits there..

geranimo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top