Read html source from WebBrowser object into string in

I want to read the html source from a webbrowser object into a string object. I found this solution:

Dim Text As String
Text = WebBrowser1.Document.documentElement.OuterHTML


 but I get the following errormessage:
'documentElement' is not a member of 'System.Windows.Forms.HtmlDocument'.

Who is Participating?
Alfred A.Connect With a Mentor Commented:

Try the following:

Dim Text as String
Text = WebBrowser1.DocumentText

I just assumed that an HTML doc has been loaded to the WebBrowser control.
jes12345Author Commented:
Nice! Thanks:)
jes12345Author Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.