?
Solved

Get HTML from Webbrowser control in VB6

Posted on 2006-03-28
6
Medium Priority
?
708 Views
Last Modified: 2013-12-25
I'm sure this has been asked plenty of times, but how can I get the HTML from a page opened in the webbrowser control in VB6? And I need it as a variable, not opened in notepad or something.
0
Comment
Question by:Kingaroo
  • 2
3 Comments
 
LVL 55

Expert Comment

by:Ryan Chong
ID: 16310747
try this maybe:

WebBrowser1.Document.documentElement.Outerhtml
0
 
LVL 20

Accepted Solution

by:
hes earned 500 total points
ID: 16310774
Dim WithEvents Web1 As InternetExplorer
Dim strHtml As String
Dim blnComp As Boolean

Private Sub Form_Load()
Set Web1 = New InternetExplorer
Web1.Navigate "www.experts-exchange.com"
Do While blnComp = False
  DoEvents
Loop
strHtml = Web1.Document.body.innerHTML ' contains the html of the page

End Sub


Private Sub Web1_DocumentComplete(ByVal pDisp As Object, url As Variant)
 blnComp = True
End Sub
0
 
LVL 20

Expert Comment

by:hes
ID: 16714326
Mine suggestion has worked for a long time :)
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question