I have to be close on this. Basically it should track links posted on my webpage, go to the link, return to my webpage and check for next.

Right now the first part:

Code:
 Dim theElementCollection As HtmlElementCollection
        theElementCollection = WebBrowser1.Document.GetElementsByTagName("a")

        Dim userName As String = textbox1.Text.Trim()
        Dim allLinks As HtmlElementCollection = WebBrowser1.Document.Links

        For Each link As HtmlElement In theElementCollection

            Dim linkfound As String = link.GetAttribute("href")
           
            If linkfound.Contains(userName) Then
                WebBrowser1.Navigate(linkfound)

                RichTextBox1.Text = RichTextBox1.Text & vbCrLf & linkfound & vbCrLf
                Timer1.Start()
                Exit For
            End If

        Next
Works perfect. Saves a copy of link in richtextbox, browses to the page and returns. (return code elsewhere)

My problem is the button starts a timer which should preform this task but now it should check links and compare them to existing ones in richtextbox. If the exact link is there do nothing and go to next foundlink. The timer code where the problem is:

Code:
Dim theElementCollection As HtmlElementCollection
            theElementCollection = WebBrowser1.Document.GetElementsByTagName("a")

            Dim userName As String = textbox1.Text.Trim()
            Dim allLinks As HtmlElementCollection = WebBrowser1.Document.Links

            For Each link As HtmlElement In theElementCollection

                Dim linkfound As String = link.GetAttribute("href")
                If linkfound.Contains(userName) Then
                  
                    For Each linkUrl In RichTextBox1.Text
                        If linkUrl = linkfound Then
                            Exit For
                        Else
                            addressbar.Text = linkfound
                            WebBrowser1.Navigate(linkfound)
                            RichTextBox1.Text = RichTextBox1.Text & vbCrLf & linkfound & vbCrLf
                        End If

                    Next

                Else
                    Exit For

                End If
            Next
        End If