click on link using webbrowser control

cengineer

Member
Joined
Aug 17, 2009
Messages
8
Programming Experience
Beginner
Hi

Is there anyone who could take a look at this issue. I am using the Webbrowser control as follows;

VB.NET:
Dim webBrowser1 As New WebBrowser
                  Dim doc As String

                [COLOR="Red"]doc = webBrowser1.Document.Body.InnerText[/COLOR]
                If (doc = Nothing) Then
                    MessageBox.Show("empty")
                End If

                For Each link In webBrowser1.Document.Links
                    If link.Id.Contains("morelangcontent") Then
                        link.Enabled = True
                    End If
                Next



The line above keeps giving me the object reference not set to an instance of error. Any ideas? I am trying to locate the link of the page and enable it.
 
You haven't navigated the browser so there is no document loaded.
 
Back
Top