Click here to Skip to main content
11,932,103 members (64,137 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


32 bookmarked

Making F1 do something useful in Visual Studio

, 12 Feb 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
F1 in Visual Studio takes forever, and rarely comes up with anything useful. Replace it with a Google MSDN search!
For Visual Studio 2008 and Visual Studio 2010:

1) Open VS, and on the Menu bar select "Tools...Macros...New Macro Project"
2) Call the project "GoogleSearchMSDN"
3) I'm so sorry about this, but VB is involved here. Not my fault, honest!
4) Rename the default Module1 to "DoGoogleSearchMSDN" - right click on the module name in the left hand pan, select "Rename"
5) Enter the following code as the module body:
Sub GoogleSearchMSDN()
    Dim url As String
    Dim searchFor As TextSelection = DTE.ActiveDocument.Selection()
    If searchFor.Text <> "" Then
        url = "" + searchFor.Text
        url = ""
    End If
    DTE.ExecuteCommand("View.URL", url)
End Sub
6) Build and save your module.
7) Use the menu bar again: "Tools...Options...Environment...Keyboard"
8) In the "Show commands containing:" textbox, type "Google" - you should see your new macro.
9) Go to the "Press shortcut keys" box, and press F1
10) Press OK.

F1 now searches for "MSDN" plus whatever you highlighted.

[edit]Took out the "C#" reference in the "searches for" comment at the end - mine does, because I put that in the URL... Blush | :O -- OriginalGriff [/edit]


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Wales Wales
Born at an early age, he grew older. At the same time, his hair grew longer, and was tied up behind his head.
Has problems spelling the word "the".
Invented the portable cat-flap.
Currently, has not died yet. Or has he?

You may also be interested in...

Comments and Discussions

QuestionCool Pin
jibesh1-Feb-13 12:50
memberjibesh1-Feb-13 12:50 
GeneralMy vote of 5 Pin
Farhan Ghumra22-Aug-12 23:49
memberFarhan Ghumra22-Aug-12 23:49 
GeneralMy vote of 5 Pin
raminxtar3-Jul-12 2:25
memberraminxtar3-Jul-12 2:25 
GeneralRe: My vote of 5 Pin
OriginalGriff3-Jul-12 2:35
mvpOriginalGriff3-Jul-12 2:35 
GeneralI didn't change a thing in Help preferences and VS (2010 Ult... Pin
Jacek Gajek12-Jan-12 11:56
memberJacek Gajek12-Jan-12 11:56 
GeneralReason for my vote of 5 Great tip, implemented it right away... Pin
hoernchenmeister20-Sep-11 3:21
memberhoernchenmeister20-Sep-11 3:21 
GeneralReason for my vote of 2 followed the description, does not w... Pin
Cristian Amarie30-Jul-11 22:16
memberCristian Amarie30-Jul-11 22:16 
GeneralCool stuff, let me do it today it self. Pin
rushijoshi11-May-11 4:59
memberrushijoshi11-May-11 4:59 
Cool stuff, let me do it today it self.
GeneralReason for my vote of 5 Great tip. Pin
HimanshuJoshi9-Mar-11 12:51
memberHimanshuJoshi9-Mar-11 12:51 
GeneralReason for my vote of 5 Thanks for sharing Pin
Patrick Kalkman28-Feb-11 5:19
memberPatrick Kalkman28-Feb-11 5:19 
GeneralReason for my vote of 5 Simple, yet brilliant idea! Pin
Stephen Haselschwerdt16-Feb-11 11:14
memberStephen Haselschwerdt16-Feb-11 11:14 
GeneralReason for my vote of 5 One of those macros that you wish yo... Pin
ctrueman14-Feb-11 12:30
memberctrueman14-Feb-11 12:30 
GeneralThis is great, I've been trying to get the help search to op... Pin
Keith.Badeau14-Feb-11 6:48
memberKeith.Badeau14-Feb-11 6:48 
GeneralRe: Regrettably, no. If there was, I'd have used it! I guess you... Pin
OriginalGriff14-Feb-11 9:38
mvpOriginalGriff14-Feb-11 9:38 
GeneralReason for my vote of 5 Sweet, real sweet! Thank you Origin... Pin
Vic Rauch12-Feb-11 18:59
memberVic Rauch12-Feb-11 18:59 
GeneralReason for my vote of 5 Cool! I shall implement this right a... Pin
Tarun.K.S12-Feb-11 7:16
memberTarun.K.S12-Feb-11 7:16 
GeneralReason for my vote of 5 Thanks for writing this up so clearl... Pin
Glenn E. Lanier II11-Feb-11 4:23
memberGlenn E. Lanier II11-Feb-11 4:23 
GeneralReason for my vote of 5 Arise, Sir Griff Pin
jim lahey10-Feb-11 5:26
memberjim lahey10-Feb-11 5:26 
GeneralThanks Pin
Dmitry Sharygin16-Feb-11 6:18
memberDmitry Sharygin16-Feb-11 6:18 
Generalcrippled version blues.. Pin
ErrolErrol14-Feb-11 8:35
memberErrolErrol14-Feb-11 8:35 
GeneralTHANK YOU!!! Pin
SBJ14-Feb-11 7:46
memberSBJ14-Feb-11 7:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.151126.1 | Last Updated 13 Feb 2011
Article Copyright 2011 by OriginalGriff
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid