首先添加引用Microsoft.mshtml,具体操作项目->添加引用->.NET找到添加就行
需要的控件webbrowser一个,button一个,如果名字不是默认请修正代码中控件名字。
然后代码如下即可:在vs2010,【.net4.0下调试通过】 Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button1.Click '获取用户选中的文字 Dim htmlDocument As mshtml.IHTMLDocument2 'IHTMLDocument2 htmlDocument = WebBrowser1.Document.DomDocument Dim currentSelection As mshtml.IHTMLSelectionObject currentSelection = htmlDocument.selection Dim range As mshtml.IHTMLTxtRange If Not (currentSelection Is Nothing) Then range = currentSelection.createRange() If Not (range Is Nothing) Then MsgBox(range.text) ‘可以进行你希望的操作 End If End If End Sub