C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Google Search Macro


Posted Date: 08 May 2008    Resource Type: Articles    Category: Web Applications
Author: narasimhaMember Level: Gold    
Rating: Points: 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  
(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: Web Applications


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use