Larry Serflaten [email@example.com] posted an interesting solution to a common news group question - how to launch Internet Explorer? He used the SHDocVw type library to instantiate a new SHDocVw.InternetExplorer. I wrote some 'demo' code to test the process and decided to make it the May 2003 tip of the month. Thanks Larry.
I created a VB6 demo program to launch NASA TV in a small IE window. Screen shots:
Click the Launch button to start NASA TV
Streaming Video using Microsoft Media Player.
Allow a few minutes for the video to begin.
Dim sFile As String
sFile = AddBackslash(App.Path) & "NasaTV.HTM"
If Len(Dir(sFile)) Then 'exist?
LaunchIE sFile 'yes
MsgBox "File not found:" & vbCrLf & sFile, vbCritical
Subroutine Description LaunchIE (URL as String) Launch Internet Explorer using URL as the address.
Module - Click for More Info Description Used in the Demo To modLaunchIE.bas Contains the subroutine described above. The subject of this tip. Include it in your application. modConnectToWebSite.bas Connect to a web site Show this info when Help/Info is selected from the demo. modInfoAbout.bas Info and about help. Provide help via the web and 'about' info. modAddBackSlash.bas Check for a right backslash and add if necessary. Add backslash to App.Path.
Click here to download the VB 6 source code [6k].
Previous Tip Tip Index Next Tip First Tip