C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » ASP.NET/Web Applications »

Google Search Macro


Posted Date: 08 May 2008    Resource Type: Articles    Category: ASP.NET/Web Applications
Author: narasimhaMember Level: Gold    
Rating: 1 out of 5Points: 10




Imports EnvDTE
Public Module Search
Sub GoogleSearch()
Dim strUrl As String
Dim selection As TextSelection = DTE.ActiveDocument.Selection()
If selection.Text <> "" Then
strUrl = "www.google.com/search?q=" + selection.Text
DTE.ExecuteCommand("View.URL", strUrl)
Else
MsgBox("Select Text first to Search")
End If
End Sub
End Module





A Google search macro - you can search Google yourself and I am sure you'll find a number of examples; probably some are more sophisticated than this one. But as a big proponent of the "Less is More" philosophy, I think this code is "just enough" to get the job done right!

First, fire up Visual Studio.NET, and choose Tools->Macros->MacroExplorer (alt -T -M -M for you shortcute dewds). You should see the Macro Explorer window, and it most likely will show "My Macros" and "Samples" nodes.

Next, right click on the topmost Macros node and choose "New Macro Project", and give it a nice name like "GoogleSearch". Double-click on your new node and it should open up the edit window on the module. Paste in the following code:

For more details, visit http://www.eggheadcafe.com/articles/20040423.asp



Responses

Author: Sebastian    13 Jun 2008Member Level: Gold   Points : 1
This is very informative. Thanks for sharing the details.


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Delete confirmation in ASP.NET gridview control
Previous Resource: PagedDataSource Class For Paging
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET/Web Applications


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use