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

HTML Preview 2

Status
Not open for further replies.

RWF

Programmer
Apr 16, 2001
24
US
I would like to open a view window for html files in a form. Any suggestions?
 
Use the MS Internet Control (found in your components window). I haven't personally used it yet, but that should do the trick. Best Regards and many Thanks!
Michael G. Bronner X-)

"Who cares how time advances? I am drinking [beer] today." Edgar Allan Poe
 
Here's how to do it:

Put this at the top of your code:

Public WithEvents WebBrowser1 As WebBrowser 'Internet Explorer control object

On form loading, do this:

Set WebBrowser1 = New InternetExplorer
WebBrowser1.Visible = False

Navigate to a site which you want the html for:

WebBrowser1.Navigate

Then, when IE has finsihed downloading, you'll need to extract the "inner html" and put it into your new window, as follows:

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Myhtmlform.Show
Myhtmlform.Text1.Text = pDisp.document.body.innerHTML
Exit sub


This will open you a new window will all the html from, in this case, the Orange website.

Hope this helps,


James.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top