You need to use the Microsoft.mshtml wrapper included with VS2008.
Here's a quick demo I've thrown together which should get you started.
Web Text Grabber.zip
This is the important code:
Code:
private void button1_Click(object sender, EventArgs e)
{
IHTMLDocument2 doc = (IHTMLDocument2)webBrowser1.Document.DomDocument;
IHTMLSelectionObject selection = doc.selection;
if (selection != null)
{
IHTMLTxtRange range = (IHTMLTxtRange)selection.createRange();
if (range != null)
this.outputbox.GrabbedText = range.text;
}
}
As you can see, the mshtml namespace includes some sweet little objects and helpers which allows you to retreive text from a .net WebBrowser control.
Hope this helps.
PS. If you can't fine mshtml.dll on your own computer, then try here: http://www.mediafire.com/?jzz2ijjlm4i