<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Dan Rigby &#187; Google</title> <atom:link href="http://danrigby.com/tag/google/feed/" rel="self" type="application/rss+xml" /><link>http://danrigby.com</link> <description>Random thoughts about Life, Technology, and Software</description> <lastBuildDate>Sat, 14 Jan 2012 19:22:00 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Quick and Easy Google (or Bing) Web Search in Visual Studio</title><link>http://danrigby.com/2010/03/03/quick-and-easy-google-or-bing-web-search-in-visual-studio/</link> <comments>http://danrigby.com/2010/03/03/quick-and-easy-google-or-bing-web-search-in-visual-studio/#comments</comments> <pubDate>Thu, 04 Mar 2010 02:48:38 +0000</pubDate> <dc:creator>Dan Rigby</dc:creator> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[Google]]></category> <category><![CDATA[VisualStudio]]></category><guid
isPermaLink="false">http://danrigby.com/?p=277</guid> <description><![CDATA[Here is a quick and easy way to add a Google (or Bing) Web Search link to the context menu in Visual Studio: - Open the Visual Studio macros IDE by navigating to Tools –&#62; Macros –&#62; Macros IDE (or pressing Alt+F11). - Right click on “MyMacros” and select Add New –&#62; Add New Item. - Select [...]]]></description> <content:encoded><![CDATA[<p><strong>Here is a quick and easy way to add a Google (or Bing) Web Search link to the context menu in Visual Studio:</strong></p><p>- Open the Visual Studio macros IDE by navigating to Tools –&gt; Macros –&gt; Macros IDE (or pressing Alt+F11).</p><p>- Right click on “MyMacros” and select Add New –&gt; Add New Item.</p><p>- Select the Module template, name the module “Search”, and click Add.</p><p>- Paste the following code directly before the “End Module” line:</p><div
class="wp_codebox"><table><tr
id="p2772"><td
class="code" id="p277code2"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Sub</span> Search()
    <span style="color: #000080;">Dim</span> strUrl <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>
    <span style="color: #000080;">Dim</span> selection <span style="color: #000080;">As</span> TextSelection = DTE.ActiveDocument.Selection()
    <span style="color: #000080;">If</span> selection.Text &lt;&gt; <span style="color: #800000;">&quot;&quot;</span> <span style="color: #000080;">Then</span>
        strUrl = <span style="color: #800000;">&quot;www.google.com/search?q=&quot;</span> + selection.Text
        <span style="color: #008000;">' strUrl = &quot;www.bing.com/search?q=&quot; + selection.Text
</span>        DTE.ExecuteCommand(<span style="color: #800000;">&quot;View.URL&quot;</span>, strUrl)
    <span style="color: #000080;">Else</span>
        MsgBox(<span style="color: #800000;">&quot;Select Text first to Search&quot;</span>)
    <span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
<span style="color: #000080;">End</span> <span style="color: #000080;">Sub</span></pre></td></tr></table></div><p>- (Optional) If you prefer to use Bing for your search, uncomment the Bing line and comment out the Google line.</p><p>- Your macro editor window should now look something like this:</p><p><a
href="http://danrigby.com/wp-content/uploads/2010/03/image.jpg?9d7bd4"><img
class="alignnone size-full wp-image-421" title="VsSearch1" src="http://danrigby.com/wp-content/uploads/2010/03/image.jpg?9d7bd4" alt="" width="640" height="480" /></a></p><p>- Save and close the Macro Editor window and IDE.</p><p>- Right click on the Visual Studio toolbar and select Customize.</p><p>- Under the Toolbars tab, check the Context Menus option and the switch to the Commands tab.</p><p>- Select the Macros Category, and then select the “MyMacros.Search.Search” macro.</p><p>- Drag the selected macro onto “Editor Context Menus” -&gt; “Code Window” and then drop it where you want it in the context menu (I place mine below the Paste command).</p><p>- Right click on the new context menu item and change it’s name to “&amp;Web Search”.</p><p>- Click close on the Customize window.</p><p>- You are now done! If everything has gone according to plan, when viewing a source code file you should now see a new context menu item that will do a web search on any selected text when you click it:</p><p><a
href="http://danrigby.com/wp-content/uploads/2010/03/image1.jpg?9d7bd4"><img
class="alignnone size-full wp-image-422" title="VsSearch2" src="http://danrigby.com/wp-content/uploads/2010/03/image1.jpg?9d7bd4" alt="" width="640" height="480" /></a></p><p><a
href="http://danrigby.com/wp-content/uploads/2010/03/image2.jpg?9d7bd4"><img
class="alignnone size-full wp-image-423" title="VsSearch3" src="http://danrigby.com/wp-content/uploads/2010/03/image2.jpg?9d7bd4" alt="" width="640" height="480" /></a></p> ]]></content:encoded> <wfw:commentRss>http://danrigby.com/2010/03/03/quick-and-easy-google-or-bing-web-search-in-visual-studio/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 338/365 objects using disk: basic

Served from: danrigby.com @ 2012-02-05 13:32:49 -->
