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

Opening a html file from VB

Status
Not open for further replies.

jbrowne

Programmer
Feb 1, 2000
182
IE
Hi all,
I want open a html file in the browser directly from a VB program as if I double clicked on the html file. Whats the best way to do this ?

John B
 
Don't know if it's the best way but I came across this messing around:

You'll need to load the Microsoft HTML Object library in your VB project. Then:
dim htmlFile as HTMLDocument
set htmlFile = new HTMLDocument
htmlFile.url = &quot;<file path and name>&quot;

This opened the file in an IE window. I'm only just starting to look into HTML so I really don't know if this is the best way (or the correct way) - you may notice that I have my own similar question in this forum!
- just thought it may help

Pete
 
Pete,

Great stuff !! That worked a treat. Thanks a million mate, you took out of bother !

John B
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top