Imports EnvDTE
Imports System.Diagnostics
Imports System.Windows.Forms
Imports System.Globalization
Public Module Search
Public Sub Google()
NavigateTo("http://www.google.com/search?q={0}")
End Sub
Private Sub NavigateTo(ByVal url As String)
Dim selection As String = DTE.ActiveDocument.Selection.Text
If selection.Length > 0 Then
DTE.ItemOperations.Navigate(String.Format(CultureInfo.InvariantCulture, url, selection), vsNavigateOptions.vsNavigateOptionsNewWindow)
Else
MessageBox.Show("No search text selected.")
End If
End Sub
End Module