<?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>Aaron Lerch &#187; tips and tricks</title>
	<atom:link href="http://www.aaronlerch.com/blog/category/tips-and-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aaronlerch.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 10 Mar 2010 12:45:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Case insensitive string comparisons with LINQ Dynamic Query</title>
		<link>http://www.aaronlerch.com/blog/2008/12/15/case-insensitive-string-comparisons-with-linq-dynamic-query/</link>
		<comments>http://www.aaronlerch.com/blog/2008/12/15/case-insensitive-string-comparisons-with-linq-dynamic-query/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 07:46:37 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2008/12/15/case-insensitive-string-comparisons-with-linq-dynamic-query/</guid>
		<description><![CDATA[LINQ rocks. It really does.
One down-side to LINQ is that, out of the box, it&#8217;s geared towards knowing your query structure at compile-time. The values can be dynamic, of course, but it&#8217;s assumed that the structure of your query is static. For example, if you want to select a set of &#34;Person&#34; objects from the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://msdn.microsoft.com/en-us/vbasic/aa904594.aspx">LINQ</a> rocks. It really does.</p>
<p>One down-side to LINQ is that, out of the box, it&#8217;s geared towards knowing your query structure at compile-time. The values can be dynamic, of course, but it&#8217;s assumed that the structure of your query is static. For example, if you want to select a set of &quot;Person&quot; objects from the &quot;People&quot; collection where Person.FirstName starts with &quot;Aar&quot;, you could write it as such:</p>
<pre class="c#" name="code">var results = from person in People
              where person.FirstName.StartsWith(&quot;Aar&quot;)
              select person;</pre>
<p>That&#8217;s all fine and good, but what about scenarios where you want to dynamically build up your query structure? In <a href="http://www.inin.com/">our</a> client application we have address books (directories) that include the ability to filter them on any, or nearly any, column:</p>
<p><img src="http://s3.amazonaws.com:80/aaronlerch.com/images/client_directory_filter.png" /></p>
<p>How would I accomplish this with LINQ? Not easily. Just ask <a href="http://www.google.com/search?q=expression+tree+site:ayende.com">Ayende</a> or <a href="http://www.google.com/search?q=expression+tree+site:blog.wekeroad.com">Rob Conery</a>, both of whom have blogged about some of their adventures in advanced usage scenarios. Enter the LINQ Dynamic Query sample from Microsoft. As usual, <a href="http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx">ScottGu&#8217;s got a good write-up</a>. In a nutshell, it&#8217;s a custom expression tree generator based on a limited (but useful) string-based query grammar. With Dynamic Query I could write the query above like this:</p>
<pre class="c#" name="code">var results = from person in People
              select person;
results = results.Where(&quot;FirstName.StartsWith(\&quot;Aar\&quot;)&quot;);</pre>
<p>It solved my problem nicely. Almost. As with my example above about matching FirstName&#8217;s, let me ask: how often does a user enter an exact case-sensitive match for what they&#8217;re looking for? I can save you the trouble and tell you: it doesn&#8217;t matter. It&#8217;s an unacceptable requirement for a user to have to match something exactly. It&#8217;s already questionable that we don&#8217;t automatically use fuzzy matching algorithms.</p>
<p>So what I really want is to specify a StringComparison enum value on the call to &quot;StartsWith&quot;:</p>
<pre class="c#" name="code">var results = from person in People
              select person;
results = results.Where(&quot;FirstName.StartsWith(\&quot;Aar\&quot;, System.StringComparison.OrdinalIgnoreCase)&quot;);</pre>
<p>Alas, this breaks. LINQ Dynamic Query doesn&#8217;t support enum values as parameters to methods. <em>So I added it.</em> I won&#8217;t redistribute the sample (I&#8217;m pretty sure I can&#8217;t, but I don&#8217;t care to anyway) so here&#8217;s what you need to do to add support for enum parsing. Note that I&#8217;ve only tested it with calls to string&#8217;s StartsWith(string, StringComparison) method. I don&#8217;t know what will happen if you sprinkle enum values in random places throughout your dynamic query. Work on My Machine, your mileage may vary, etc. etc. etc.</p>
<p><strong>1.</strong> <a href="http://msdn2.microsoft.com/en-us/vcsharp/bb894665.aspx">Download the sample.</a></p>
<p><strong>2.</strong> Crack open the Dynamic.cs source file. It&#8217;s scary, but you can do it. Modify it like so (I added the &quot;if (ParseEnumType&#8230;&quot;</p>
<pre class="c#" name="code">Expression ParseIdentifier() {
    ValidateToken(TokenId.Identifier);
    object value;
    if (keywords.TryGetValue(token.text, out value)) {
        if (value is Type) return ParseTypeAccess((Type)value);
        if (value == (object)keywordIt) return ParseIt();
        if (value == (object)keywordIif) return ParseIif();
        if (value == (object)keywordNew) return ParseNew();
        NextToken();
        return (Expression)value;
    }
    if (symbols.TryGetValue(token.text, out value) ||
        externals != null &amp;&amp; externals.TryGetValue(token.text, out value)) {
        Expression expr = value as Expression;
        if (expr == null) {
            expr = Expression.Constant(value);
        }
        else {
            LambdaExpression lambda = expr as LambdaExpression;
            if (lambda != null) return ParseLambdaInvocation(lambda);
        }
        NextToken();
        return expr;
    }
    // ADD THIS IF STATEMENT
    if (ParseEnumType(out value))
    {
        Expression expr = Expression.Constant(value);
        NextToken();
        return expr;
    }
    if (it != null) return ParseMemberAccess(null, it);
    throw ParseError(Res.UnknownIdentifier, token.text);
}</pre>
<p><strong>3.</strong> Add the definition for ParseEnumType. This little bit of nastiness is essentially doing a look-ahead to resolve a type name, since most of the parser&#8217;s rules are built to process more contextual information (such as a property name of a type, etc.) In our case, we need to attempt to match &quot;Foo.Foo.Foo&quot; to a type name, and if it doesn&#8217;t end up resolving, we need to reset the parser back to the beginning of &quot;Foo&quot; to continue parsing.</p>
<pre class="c#" name="code">bool ParseEnumType(out object value)
{
    value = null;

    ValidateToken(TokenId.Identifier);
    Type enumType = null;
    int position = token.pos;
    string typeName = token.text;
    while (enumType == null)
    {
        // Loop until we stop processing identifiers and/or dots
        enumType = Type.GetType(typeName, false, true);
        if (enumType == null)
        {
            NextToken();
            if (token.id == TokenId.Dot)
            {
                typeName += token.text;
                NextToken();
                if (token.id == TokenId.Identifier)
                {
                    typeName += token.text;
                }
                else
                {
                    break;
                }
            }
            else
            {
                break;
            }
        }
    }

    if ((enumType != null) &amp;&amp; IsEnumType(enumType))
    {
        NextToken();
        ValidateToken(TokenId.Dot, Res.DotExpected);
        NextToken();
        ValidateToken(TokenId.Identifier, Res.IdentifierExpected);
        value = Enum.Parse(enumType, token.text, true);
        return true;
    }
    else
    {
        SetTextPos(position);
        NextToken();
    }

    return false;
}</pre>
<p><strong>4.</strong> Add an error &quot;resource&quot; string (but not really a true resource string) to the &quot;Res&quot; static class. We added a new condition, so we need an error message to match.</p>
<pre class="c#" name="code">public const string DotExpected = &quot;'.' expected&quot;;</pre>
<p>Voila! Make sure your enum values are fully-qualified type names and you&#8217;ll be good to go.</p>
<p>Hopefully this works for you as well as it did for me, and I have to say I can&#8217;t believe I couldn&#8217;t find this on the &#8216;net, as I imagine this is a very common use-case.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2008/12/15/case-insensitive-string-comparisons-with-linq-dynamic-query/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Email tip: auto-linking paths containing spaces in Outlook</title>
		<link>http://www.aaronlerch.com/blog/2007/12/14/email-tip-auto-linking-paths-containing-spaces-in-outlook/</link>
		<comments>http://www.aaronlerch.com/blog/2007/12/14/email-tip-auto-linking-paths-containing-spaces-in-outlook/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 16:41:02 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2007/12/14/email-tip-auto-linking-paths-containing-spaces-in-outlook/</guid>
		<description><![CDATA[I frequently get emails containing links to file shares on various servers. Most people just grab the path from windows explorer and paste it into the email which is a shame, because it ends up auto-linking only the first part of the path. For example, &#8220;\\server\share with space in the name&#8221; auto-links &#8220;\\server\share&#8221; only.
 
Tip: [...]]]></description>
			<content:encoded><![CDATA[<p>I frequently get emails containing links to file shares on various servers. Most people just grab the path from windows explorer and paste it into the email which is a shame, because it ends up auto-linking only the first part of the path. For example, &#8220;\\server\share with space in the name&#8221; auto-links &#8220;\\server\share&#8221; only.</p>
<p><a href="http://www.aaronlerch.com/files/blog/Emailtipautolinkingpathscontainingspaces_A440/image.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="428" alt="image" src="http://www.aaronlerch.com/files/blog/Emailtipautolinkingpathscontainingspaces_A440/image_thumb.png" width="452" border="0"></a> </p>
<p>Tip: if you surround the path with angle brackets (&#8220;&lt;&gt;&#8221;) it&#8217;ll link the whole thing. Typing it in, pasting, whatever, just get the path between the greater-than/less-than characters and when you type a whitespace/carriage return character Outlook will auto-link the path for you.</p>
<p><a href="http://www.aaronlerch.com/files/blog/Emailtipautolinkingpathscontainingspaces_A440/image_3.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="455" alt="image" src="http://www.aaronlerch.com/files/blog/Emailtipautolinkingpathscontainingspaces_A440/image_thumb_3.png" width="452" border="0"></a> </p>
<p>It&#8217;s one of those time savers that add up over time to give you back a few minutes of your life per day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2007/12/14/email-tip-auto-linking-paths-containing-spaces-in-outlook/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Targeting .NET 2.0 and using C# 3.0 language features</title>
		<link>http://www.aaronlerch.com/blog/2007/12/02/targeting-net-20-and-using-c-30-language-features/</link>
		<comments>http://www.aaronlerch.com/blog/2007/12/02/targeting-net-20-and-using-c-30-language-features/#comments</comments>
		<pubDate>Sun, 02 Dec 2007 21:13:23 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2007/12/02/targeting-net-20-and-using-c-30-language-features/</guid>
		<description><![CDATA[Did you know you can use most of the new C# 3.0 language features in VS2008 under a project that&#8217;s targeted at .NET 2.0? How cool is that? And it makes sense, too, since there&#8217;s nothing new for the 2.0 runtime, it&#8217;s all compiler magic. I found it by accident &#8211; I found Daniel Moth&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.danielmoth.com/Blog/2007/05/using-c-30-from-net-20.html">Did you know</a> you can use most of the new C# 3.0 language features in VS2008 under a project that&#8217;s targeted at .NET 2.0? How cool is that? And it makes sense, too, since there&#8217;s nothing new for the 2.0 runtime, it&#8217;s all compiler magic. I found it by accident &#8211; I found Daniel Moth&#8217;s post after the fact &#8211; I typed &#8220;prop&#8221; to access the snippet for generating a property. In VS2008, that snippet generates an <a href="http://weblogs.asp.net/scottgu/archive/2007/03/08/new-c-orcas-language-features-automatic-properties-object-initializers-and-collection-initializers.aspx">Automatic Property</a> by default.</p>
<p><a href="http://www.aaronlerch.com/files/blog/Targeting.NET2.0andusi.0languagefeatures_E3D4/image.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="74" alt="image" src="http://www.aaronlerch.com/files/blog/Targeting.NET2.0andusi.0languagefeatures_E3D4/image_thumb.png" width="383" border="0"></a> </p>
<p>I can&#8217;t decide whether this post should be categorized as a tip/trick or a warning, though. It&#8217;s both, probably.</p>
<p>In many development environments you won&#8217;t care &#8211; if you upgrade to Visual Studio 2008 then your build environment is upgraded also. But in some places, such as my company, we have large code bases that span many different technologies, and we have a specially created build system to handle all that. It uses specific compilers &#8211; VS7.1 for C++, for example, and the .NET 2.0 SDK compiler for C#.</p>
<p>You can <a href="http://www.west-wind.com/weblog/posts/122975.aspx">use Visual Studio 2008 for Visual Studio 2005 project files</a>, and with multi-targeting, you can use it in a .NET 2.0 environment. So, back to me as an example, I can transparently use VS2008 as my new IDE of choice &#8211; <em>on my local machine</em>. That means when I build from VS2008 locally, the new C# 3.0 language features will work seamlessly, but will fail when our automated builds pick up my changes.</p>
<p>Thus the warning &#8211; if you&#8217;re not careful (if you&#8217;re on &#8220;autopilot&#8221;) you can write code that will compile in the IDE but not with an SDK.</p>
<p>So, use VS2008, and be careful. <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br />In my case, I always build from the command line anyway &#8211; that way I <em>know</em> that what I check in will build everywhere.</p>
<p>I did have a note to myself to get the .NET 3.5 SDK integrated into our build system, but I see that <a href="http://blogs.msdn.com/windowssdk/archive/2007/06/12/what-is-net-3-5.aspx">a stand-alone version doesn&#8217;t exist</a> &#8211; it&#8217;s being rolled into the Windows SDK which would have far too wide an impact. &lt;sigh&gt;</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5fa73dbc-5264-40f7-a42e-45ad2b133f22" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/.NET" rel="tag">.NET</a>, <a href="http://technorati.com/tags/Visual%20Studio" rel="tag">Visual Studio</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2007/12/02/targeting-net-20-and-using-c-30-language-features/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to easily redirect an email thread in Outlook</title>
		<link>http://www.aaronlerch.com/blog/2007/10/24/how-to-easily-redirect-an-email-thread-in-outlook/</link>
		<comments>http://www.aaronlerch.com/blog/2007/10/24/how-to-easily-redirect-an-email-thread-in-outlook/#comments</comments>
		<pubDate>Wed, 24 Oct 2007 20:25:03 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2007/10/24/how-to-easily-redirect-an-email-thread-in-outlook/</guid>
		<description><![CDATA[Scott Hanselman posted a quick-and-dirty way to disable &#8220;Reply To All&#8221; and &#8220;Forward&#8221; (within Outlook, internal users only) for those cases where you just want a reply to yourself.
With the amount of email we get at my company, that&#8217;s a pretty useful (and simple!) trick. I used it internally, which of course started a big [...]]]></description>
			<content:encoded><![CDATA[<p>Scott Hanselman <a href="http://www.hanselman.com/blog/HowToEasilyDisableReplyToAllAndForwardInOutlook.aspx">posted a quick-and-dirty way</a> to disable &#8220;Reply To All&#8221; and &#8220;Forward&#8221; (within Outlook, internal users only) for those cases where you just want a reply to yourself.</p>
<p>With the amount of email we get at my company, that&#8217;s a pretty useful (and simple!) trick. I used it internally, which of course started a big time-wasting email thread testing it, joking, etc. And it resulted in my friend <a href="http://blog.scauer.com/">Scott Bauer</a> creating the &#8220;anti-Hanselman&#8221; macro&#8211;same creation instructions as Hanselman&#8217;s, just use this code instead. <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre>ActiveInspector.CurrentItem.Actions("Reply to All").Enabled = True
ActiveInspector.CurrentItem.Actions("Forward").Enabled = True</pre>
<p>Anyway, it got me thinking about another common scenario we run into frequently. <strong>An email gets sent to the wrong distribution list.</strong> Doesn&#8217;t sound so horrible, does it? But it gets much worse when the email thread goes for a long time and plenty of people who don&#8217;t care are on the recipient list. You start getting a few emails like &#8220;take me off this thread please&#8221;, but most of just keep hitting Delete, and it wastes everybody&#8217;s time. (You can&#8217;t ignore it because it <em>might</em> be relevant-how can you tell, all you see is a &#8220;you&#8217;ve got mail&#8221; notice, and you don&#8217;t want to have to create a rule for every email thread like this.)</p>
<p>Here is how I deal with this scenario:</p>
<ol>
<li>Forward the email (to maintain attachments, etc.)
<li>Send it <em>TO</em> the original sender and the new (appropriate) distribution list/recipient
<li>Maintain the <em>CC</em> list, as they probably still care
<li><em>BCC</em> everybody on the original To list
<li>Add a line that says &#8220;Forwarding to the appropriate group, BCC&#8217;ing everybody else&#8221; &#8211; or something to that effect
<li>(<em>Here&#8217;s the key</em>) Set the &#8220;Direct Replies To&#8221; field to the new list I&#8217;m forwarding to:<br /><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="20" alt="image" src="http://www.aaronlerch.com/files/blog/HowtoeasilyredirectanemailthreadinOutloo_D9B4/image.png" width="264" align="absMiddle" border="0"> </li>
</ol>
<p>By directing replies to the list I&#8217;m redirecting to, I effectively take myself out of the loop. Otherwise I unnecessarily sacrifice myself for everybody else by remaining on the irrelevant thread.</p>
<p>Needless to say that gets annoying to do frequently. So, Scott (Hanselman <em>and</em> Bauer) motivated me to create a macro to automate it.</p>
<p>I won&#8217;t repeat the details of how to create the macro, and add a button to your message header, etc. <a href="http://www.hanselman.com/blog/HowToEasilyDisableReplyToAllAndForwardInOutlook.aspx">Go read Scott Hanselman&#8217;s walk-through on how to do that.</a> Then come back here. But just remember to add the macro &#8220;toolbar button&#8221; to a <em>received</em> message, not a new outgoing message (there is a difference!). I selected the right-arrow-in-a-circle icon for mine (<a href="http://www.aaronlerch.com/files/blog/HowtoeasilyredirectanemailthreadinOutloo_D9B4/image_3.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="24" alt="image" src="http://www.aaronlerch.com/files/blog/HowtoeasilyredirectanemailthreadinOutloo_D9B4/image_thumb.png" width="24" align="absMiddle" border="0"></a>), sort of indicating a different kind of &#8220;forward&#8221;.</p>
<p>Now, when I get an email like this:</p>
<p><a href="http://www.aaronlerch.com/files/blog/HowtoeasilyredirectanemailthreadinOutloo_D9B4/image_4.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="510" alt="image" src="http://www.aaronlerch.com/files/blog/HowtoeasilyredirectanemailthreadinOutloo_D9B4/image_thumb_3.png" width="478" border="0"></a></p>
<p>I can click the &#8220;Redirect Email&#8221; macro and I&#8217;m prompted to select some addresses from the address book. After I select them (&#8220;Accounting&#8221; in this case), I get a new mail, pre-filled out and ready to send.</p>
<p><a href="http://www.aaronlerch.com/files/blog/HowtoeasilyredirectanemailthreadinOutloo_D9B4/image_5.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="555" alt="image" src="http://www.aaronlerch.com/files/blog/HowtoeasilyredirectanemailthreadinOutloo_D9B4/image_thumb_4.png" width="476" border="0"></a></p>
<p>Notice that the &#8220;Direct Replies To&#8221; button is highlighted (it&#8217;s the image of the person with the left-facing purple arrow), indicating that its value is set. Clicking the button shows that it is indeed set:</p>
<p><a href="http://www.aaronlerch.com/files/blog/HowtoeasilyredirectanemailthreadinOutloo_D9B4/image_6.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="66" alt="image" src="http://www.aaronlerch.com/files/blog/HowtoeasilyredirectanemailthreadinOutloo_D9B4/image_thumb_5.png" width="315" border="0"></a></p>
<p>All I have to do is press send. Much easier and much faster than doing all that work by hand.</p>
<p>Paste the following into your macro definition and tweak if you like &#8211; I&#8217;m not a VB/VBA programmer, so I&#8217;m sure it&#8217;s not perfect. Post back here if you tweak it and improve it. Also note that I&#8217;m including the &#8220;Sub&#8221; definition, to give my snippet some context. You should already have one created if you follow Scott&#8217;s instructions.</p>
<pre class="csharpcode"><span class="kwrd">Sub</span> RedirectMail()
    <span class="kwrd">Dim</span> mail <span class="kwrd">As</span> MailItem
    <span class="kwrd">Dim</span> forward <span class="kwrd">As</span> MailItem
    <span class="kwrd">Dim</span> recipient <span class="kwrd">As</span> recipient
    <span class="kwrd">Set</span> mail = ActiveInspector.CurrentItem

    <span class="kwrd">Dim</span> selectNamesDlg <span class="kwrd">As</span> SelectNamesDialog
    <span class="kwrd">Set</span> selectNamesDlg = Application.Session.GetSelectNamesDialog
    selectNamesDlg.ForceResolution = <span class="kwrd">True</span>
    <span class="kwrd">If</span> (selectNamesDlg.Display <span class="kwrd">And</span> selectNamesDlg.Recipients.Count &gt; 0) <span class="kwrd">Then</span>

        <span class="rem">' Forward this mail item, initializing the "To" line with:</span>
        <span class="rem">' The original sender of the mail, and the newly selected recipients</span>
        <span class="rem">' Direct replies to the newly selected recipients</span>
        <span class="rem">' People originally on the CC line still get CC'd</span>
        <span class="rem">' Add everybody else on the BCC line</span>

        <span class="kwrd">Set</span> forward = mail.forward

        <span class="kwrd">If</span> (forward.ReplyRecipients.Count &gt; 0) <span class="kwrd">Then</span>
            <span class="kwrd">For</span> i = 1 <span class="kwrd">To</span> forward.ReplyRecipients.Count
                forward.ReplyRecipients.Remove (i)
            <span class="kwrd">Next</span> i
        <span class="kwrd">End</span> <span class="kwrd">If</span>

        forward.Recipients.Add (mail.SenderEmailAddress)

        <span class="kwrd">For</span> <span class="kwrd">Each</span> recipient <span class="kwrd">In</span> selectNamesDlg.Recipients
            forward.Recipients.Add (recipient.Name)
            forward.ReplyRecipients.Add (recipient.Name)
        <span class="kwrd">Next</span> recipient

        <span class="kwrd">For</span> <span class="kwrd">Each</span> recipient <span class="kwrd">In</span> mail.Recipients
            <span class="kwrd">Set</span> theRecipient = forward.Recipients.Add(recipient.Name)
            theRecipient.Type = recipient.Type

            <span class="kwrd">If</span> (recipient.Type &lt;&gt; olCC) <span class="kwrd">Then</span>
                theRecipient.Type = olBCC
            <span class="kwrd">End</span> <span class="kwrd">If</span>
        <span class="kwrd">Next</span> recipient

        <span class="kwrd">If</span> (forward.BodyFormat = olFormatPlain <span class="kwrd">Or</span> olFormatUnspecified) <span class="kwrd">Then</span>
            forward.Body = <span class="str">"Redirecting to the appropriate distribution, and BCC'ing others"</span> + forward.Body
        <span class="kwrd">Else</span>
            forward.HTMLBody = <span class="str">"Redirecting to the appropriate distribution, and BCC'ing others"</span> + forward.HTMLBody
        <span class="kwrd">End</span> <span class="kwrd">If</span>

        forward.Recipients.ResolveAll
        forward.Display

    <span class="kwrd">End</span> <span class="kwrd">If</span>
<span class="kwrd">End</span> Sub</pre>
<p></p>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<p>Enjoy!</p>
<p><strong>Update:</strong> <a href="http://www.leeholmes.com/blog/ThePerilsOfBCC.aspx">Lee Holmes posted</a> some good reasons why you shouldn&#8217;t use BCC. Please take that into account when using this macro &#8211; in my situation, this macro is useful, mostly because of the way my co-workers tend to use email coupled with the size of the distribution lists. It isn&#8217;t necessarily a good solution for everybody!</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http://www.aaronlerch.com/blog/2007/10/24/how-to-easily-redirect-an-email-thread-in-outlook/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://www.aaronlerch.com/blog/2007/10/24/how-to-easily-redirect-an-email-thread-in-outlook/" border="0" alt="kick it on DotNetKicks.com" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2007/10/24/how-to-easily-redirect-an-email-thread-in-outlook/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Proceed with Caution: Strongly Typed Resources Ahead</title>
		<link>http://www.aaronlerch.com/blog/2007/10/14/proceed-with-caution-strongly-typed-resources-ahead/</link>
		<comments>http://www.aaronlerch.com/blog/2007/10/14/proceed-with-caution-strongly-typed-resources-ahead/#comments</comments>
		<pubDate>Sun, 14 Oct 2007 20:23:08 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2007/10/14/proceed-with-caution-strongly-typed-resources-ahead/</guid>
		<description><![CDATA[Visual Studio 2005 made using embedded resources a much more integrated experience than it was in Visual Studio 2003. But what I didn&#8217;t know is that there are some important things to be aware of when referencing these resources. A leaky abstraction strikes again!
The Problem
Even though it &#8220;seems&#8221; like a static resource, accessed via a [...]]]></description>
			<content:encoded><![CDATA[<p>Visual Studio 2005 made using embedded resources a much more integrated experience than it was in Visual Studio 2003. But what I didn&#8217;t know is that there are some important things to be aware of when referencing these resources. A <a href="http://www.joelonsoftware.com/articles/LeakyAbstractions.html">leaky abstraction</a> strikes again!</p>
<h4>The Problem</h4>
<p>Even though it &#8220;seems&#8221; like a static resource, accessed via a static property, should create an instance once and only once, it&#8217;s not true. Consider adding and using an image resource &#8211; for example, a &#8220;lock&#8221; image that could be shown in the rows of a <a title="DataGridView Class" href="http://msdn2.microsoft.com/wc5cbb9z.aspx">DataGridView</a> to represent a boolean value:</p>
<p><a href="http://www.aaronlerch.com/files/blog/ProceedwithCautionStronglyTypedResources_7AC/image.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="116" alt="image" src="http://www.aaronlerch.com/files/blog/ProceedwithCautionStronglyTypedResources_7AC/image_thumb.png" width="183" border="0"></a> </p>
<p>One way to translate the data type of a bound object to an &#8220;expected&#8221; data type for a DataGridView column is to handle the CellFormatting event. You might be tempted to write the code to reference your strongly typed &#8220;lock&#8221; image resource like this:</p>
<pre class="code"><span style="color: rgb(0,0,255)">private</span> <span style="color: rgb(0,0,255)">static</span> <span style="color: rgb(43,145,175)">Image</span> _blankIcon = <span style="color: rgb(0,0,255)">new</span> <span style="color: rgb(43,145,175)">Bitmap</span>(16, 16);
<span style="color: rgb(0,0,255)">private</span> <span style="color: rgb(0,0,255)">void</span> transactionDataGridView_CellFormatting(<span style="color: rgb(0,0,255)">object</span> sender, <span style="color: rgb(43,145,175)">DataGridViewCellFormattingEventArgs</span> e)
{
    <span style="color: rgb(0,0,255)">if</span> ((e.ColumnIndex == Locked.Index)
        &amp;&amp; (e.DesiredType == <span style="color: rgb(0,0,255)">typeof</span>(<span style="color: rgb(43,145,175)">Image</span>))
        &amp;&amp; (e.Value <span style="color: rgb(0,0,255)">is</span> <span style="color: rgb(0,0,255)">bool</span>))
    {
        <span style="color: rgb(0,0,255)">bool</span> locked = (<span style="color: rgb(0,0,255)">bool</span>)e.Value;
        e.Value = (locked) ? Properties.<span style="color: rgb(43,145,175)">Resources</span>.LockIcon : _blankIcon;
        e.FormattingApplied = <span style="color: rgb(0,0,255)">true</span>;
    }
}</pre>
<p>But you could very easily encounter a <a title="Win32Exception Class" href="http://msdn2.microsoft.com/tac3tbxc.aspx">Win32Exception</a> indicating that you are out of memory. Why? The short answer is that every reference to the property ends up creating a new instance of the resource. With images, movies, or sounds, that can end up using a lot of memory. Notice that the code generated for accessing the resource doesn&#8217;t perform any caching, and in fact two instances of the returned object are logically the same, but are not the same reference. The following is true: &#8220;Properties.Resources.LockIcon != Properties.Resources.LockIcon&#8221;.</p>
<pre class="code"><span style="color: rgb(0,0,255)">internal</span> <span style="color: rgb(0,0,255)">static</span> System.Drawing.<span style="color: rgb(43,145,175)">Bitmap</span> LockIcon {
    <span style="color: rgb(0,0,255)">get</span> {
        <span style="color: rgb(0,0,255)">object</span> obj = ResourceManager.GetObject(<span style="color: rgb(163,21,21)">"LockIcon"</span>, resourceCulture);
        <span style="color: rgb(0,0,255)">return</span> ((System.Drawing.<span style="color: rgb(43,145,175)">Bitmap</span>)(obj));
    }
}</pre>
<h4>The Solution</h4>
<p>It&#8217;s simple, really, but you just have to <em>know</em> to do it. The only real solution is to be intelligent about accessing these resources such that as few instances as possible are created. 99% of the time that means creating a global static variable that is initialized with the resource, and all your code accesses your static variable. This can be time consuming to maintain, if you have a lot of resources, but it&#8217;s definitely worth it. The change to the CellFormatting event handler is a simple one.</p>
<pre class="code"><span style="color: rgb(0,0,255)">private</span> <span style="color: rgb(0,0,255)">static</span> <span style="color: rgb(43,145,175)">Image</span> _lockIcon = Properties.<span style="color: rgb(43,145,175)">Resources</span>.LockIcon;
<span style="color: rgb(0,0,255)">private</span> <span style="color: rgb(0,0,255)">static</span> <span style="color: rgb(43,145,175)">Image</span> _blankIcon = <span style="color: rgb(0,0,255)">new</span> <span style="color: rgb(43,145,175)">Bitmap</span>(16, 16);
<span style="color: rgb(0,0,255)">private</span> <span style="color: rgb(0,0,255)">void</span> transactionDataGridView_CellFormatting(<span style="color: rgb(0,0,255)">object</span> sender, <span style="color: rgb(43,145,175)">DataGridViewCellFormattingEventArgs</span> e)
{
    <span style="color: rgb(0,0,255)">if</span> ((e.ColumnIndex == Locked.Index)
        &amp;&amp; (e.DesiredType == <span style="color: rgb(0,0,255)">typeof</span>(<span style="color: rgb(43,145,175)">Image</span>))
        &amp;&amp; (e.Value <span style="color: rgb(0,0,255)">is</span> <span style="color: rgb(0,0,255)">bool</span>))
    {
        <span style="color: rgb(0,0,255)">bool</span> locked = (<span style="color: rgb(0,0,255)">bool</span>)e.Value;
        e.Value = (locked) ? _lockIcon : _blankIcon;
        e.FormattingApplied = <span style="color: rgb(0,0,255)">true</span>;
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>One possibility that could increase maintainability is to write your own Visual Studio custom tool that generates the strongly-typed resource class (the .Designer.cs file). The custom tool could create the standard resource access code but also create a 2nd class that ends in &#8220;Cache&#8221;, for example, and manages a static reference to each resource &#8211; as mentioned in this <a href="https://forums.microsoft.com/msdn/showpost.aspx?postid=616110&amp;siteid=1">MSDN forum post</a>. An <a href="http://www.codeproject.com/dotnet/ResXFileCodeGeneratorEx.asp?df=100">article on The Code Project</a> gives an example implementation of a custom tool. I downloaded it with the intention of doing exactly what I mentioned, but there&#8217;s quite a bit of code there &#8211; and it&#8217;s a lot less trivial than I had hoped. In addition, everybody would have to install this custom tool on their own machine, and would have to manually run it on resource files. Non-optimal. Oh, and I&#8217;m lazy. <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e486ce96-1e2d-482e-b530-0fac2255ca9a" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Strongly%20Typed%20Resources" rel="tag">Strongly Typed Resources</a>, <a href="http://technorati.com/tags/Visual%20Studio" rel="tag">Visual Studio</a>, <a href="http://technorati.com/tags/Leaky%20Abstraction" rel="tag">Leaky Abstraction</a></div>
<p><a href="http://www.dotnetkicks.com/kick/?url=http://www.aaronlerch.com/blog/2007/10/14/proceed-with-caution-strongly-typed-resources-ahead/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://www.aaronlerch.com/blog/2007/10/14/proceed-with-caution-strongly-typed-resources-ahead/" border="0" alt="kick it on DotNetKicks.com" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2007/10/14/proceed-with-caution-strongly-typed-resources-ahead/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>TIP: Set breakpoints without source code in Visual Studio 2005</title>
		<link>http://www.aaronlerch.com/blog/2007/08/31/tip-set-breakpoints-without-source-code-in-visual-studio-2005/</link>
		<comments>http://www.aaronlerch.com/blog/2007/08/31/tip-set-breakpoints-without-source-code-in-visual-studio-2005/#comments</comments>
		<pubDate>Fri, 31 Aug 2007 18:15:55 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[debugging]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2007/08/31/tip-set-breakpoints-without-source-code-in-visual-studio-2005/</guid>
		<description><![CDATA[This was probably my favorite Visual Studio 2005 tip I learned in the Mastering .NET Debugging class I recently took. John Robbins is awesome.   This tip lets you set a breakpoint at any arbitrary location &#8211; no source code required! Think framework library, or 3rd party library, or any commonly called code (that [...]]]></description>
			<content:encoded><![CDATA[<p>This was probably my favorite Visual Studio 2005 tip I learned in the Mastering .NET Debugging class <a href="http://www.aaronlerch.com/blog/2007/08/31/mastering-net-debugging-with-john-robbins/">I recently took</a>. <a href="http://www.wintellect.com/cs/blogs/jrobbins/default.aspx">John Robbins is awesome.</a> <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This tip lets you set a breakpoint at any arbitrary location &#8211; no source code required! Think framework library, or 3rd party library, or any commonly called code (that you don&#8217;t have source for) where you don&#8217;t want to set breakpoints on every single call into the code.</p>
<p>There are a couple of gotchas that have to be configured for this to work. I was scratching my head wondering why this didn&#8217;t work for me immediately, here&#8217;s why.</p>
<p><strong>First</strong>, make sure the &#8220;Just My Code&#8221; setting is turned OFF in the Visual Studio settings (Tools -&gt; Options -&gt; Debugging). In fact, just leave this setting off all the time &#8212; it sucks. <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br /><a href="http://www.aaronlerch.com/files/blog/TIPSetbreakpointswithoutsourcecode_BA97/Options_3.png" atomicselection="true"><img height="297" alt="Options" src="http://www.aaronlerch.com/files/blog/TIPSetbreakpointswithoutsourcecode_BA97/Options_thumb_3.png" width="500" border="0"></a> </p>
<p><strong>Secondly</strong>, make sure you have a symbol path configured so you can load the appropriate symbols. <em>You must have symbols for the &#8220;source-less&#8221; code!</em> The symbol path/server is specified via an environment variable named &#8220;<a href="http://support.microsoft.com/kb/311503">_NT_SYMBOL_PATH</a>&#8220;. If you don&#8217;t have a symbol server configured (more on that in a later post) your environment variable will probably look like this: (see the previous link for the exact syntax)</p>
<p><code>_NT_SYMBOL_PATH = SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols</code></p>
<p>You can also configure symbols from within Visual Studio in the Tools -&gt; Options -&gt; Debugging -&gt; Symbols configuration:<br /><a href="http://www.aaronlerch.com/files/blog/TIPSetbreakpointswithoutsourcecode_BA97/Options2_3.png" atomicselection="true"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="301" alt="Options (2)" src="http://www.aaronlerch.com/files/blog/TIPSetbreakpointswithoutsourcecode_BA97/Options2_thumb_3.png" width="500" border="0"></a> </p>
<p>Now, start debugging your application (have it break on the first instruction of the app). This is especially important if Visual Studio hasn&#8217;t yet pulled down the symbols from the symbol server. Bring up the breakpoint window in Visual Studio (CTRL+B) and type in enough detail for the resolver to find the method/property you&#8217;re looking for. If you want to break on a property, be sure to use the method syntax for the property: &#8220;get_[propertyname]&#8221; or &#8220;set_[propertyname]&#8220;.<br /><a href="http://www.aaronlerch.com/files/blog/TIPSetbreakpointswithoutsourcecode_BA97/NewBreakpoint_3.png" atomicselection="true"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="New Breakpoint" src="http://www.aaronlerch.com/files/blog/TIPSetbreakpointswithoutsourcecode_BA97/NewBreakpoint_thumb_3.png" width="500" border="0"></a> </p>
<p>Hit OK, and, if you had &#8220;Use Intellisense to verify the function name&#8221; selected, press &#8220;Yes&#8221;:<br /><a href="http://www.aaronlerch.com/files/blog/TIPSetbreakpointswithoutsourcecode_BA97/MicrosoftVisualStudio_3.png" atomicselection="true"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="183" alt="Microsoft Visual Studio" src="http://www.aaronlerch.com/files/blog/TIPSetbreakpointswithoutsourcecode_BA97/MicrosoftVisualStudio_thumb_3.png" width="500" border="0"></a> </p>
<p>At this point, if your code calls the method or property, the debugger will break on it and take you to the Disassembly view. You can use the Call Stack window to traverse up to whatever point you care about. Notice also that in this example, &#8220;child&#8221; breakpoints were automatically set on all the overloaded methods for System.Console.WriteLine, automatically.<br /><a href="http://www.aaronlerch.com/files/blog/TIPSetbreakpointswithoutsourcecode_BA97/CropperCapture5_3.png" atomicselection="true"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="203" alt="CropperCapture[5]" src="http://www.aaronlerch.com/files/blog/TIPSetbreakpointswithoutsourcecode_BA97/CropperCapture5_thumb_3.png" width="500" border="0"></a> </p>
<p>This is an awesome trick, one that can save you loads of time! Thanks John! <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2007/08/31/tip-set-breakpoints-without-source-code-in-visual-studio-2005/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TIP: Create a &#8220;new mail&#8221; shortcut for Outlook</title>
		<link>http://www.aaronlerch.com/blog/2007/07/31/tip-create-a-new-mail-shortcut-for-outlook/</link>
		<comments>http://www.aaronlerch.com/blog/2007/07/31/tip-create-a-new-mail-shortcut-for-outlook/#comments</comments>
		<pubDate>Tue, 31 Jul 2007 15:45:00 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2007/07/31/tip-create-a-new-mail-shortcut-for-outlook/</guid>
		<description><![CDATA[If you work at a company that&#8217;s as email-centric as mine, you&#8217;ll find yourself opening the &#8220;new mail&#8221; window in Outlook quite a bit.  Although hopefully not too much &#8211; better to be responding to email than initiating new threads, though even that can get out of hand. The fewer people that generate email [...]]]></description>
			<content:encoded><![CDATA[<p>If you work at a company that&#8217;s as email-centric as <a href="http://www.inin.com/" title="Interactive Intelligence">mine</a>, you&#8217;ll find yourself opening the &#8220;new mail&#8221; window in Outlook quite a bit.  Although hopefully not too much &#8211; better to be responding to email than initiating new threads, though even that can <a href="http://www.hanselman.com/blog/ReplyToAllSnowballKnowWhenToEscalateCommunication.aspx">get out of hand</a>. The fewer people that generate email threads, the less email there is requiring a response!  Any and every keyboard shortcut helps shave off seconds throughout the day, <a href="http://www.codinghorror.com/blog/archives/000825.html">which add up over time</a>.  My friend <a href="http://www.thehubbards.org/blog/">Chris</a> stopped by and showed me how to create a shortcut directly to &#8220;New Mail&#8221;.  Combine that with the <a href="http://www.aaronlerch.com/blog/2007/05/vista-launch-hotkeys.html">Vista Quicklaunch keyboard shortcuts</a>, and Win+2* gets me a new mail message. Sweet.</p>
<p>It&#8217;s simple: create a shortcut with the following target.<br />
&#8220;C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE&#8221; /c &#8220;IPM.Note&#8221;<br />
(if your path to OUTLOOK.EXE differs, use yours)</p>
<p>Thanks Chris!<br />
* Win+1 is, and always will be, <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx">PowerShell</a>. <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2007/07/31/tip-create-a-new-mail-shortcut-for-outlook/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Vista &#8220;Quick Launch&#8221; Hotkeys</title>
		<link>http://www.aaronlerch.com/blog/2007/05/17/vista-quick-launch-hotkeys/</link>
		<comments>http://www.aaronlerch.com/blog/2007/05/17/vista-quick-launch-hotkeys/#comments</comments>
		<pubDate>Thu, 17 May 2007 16:37:00 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2007/05/17/vista-quick-launch-hotkeys/</guid>
		<description><![CDATA[My friend and coworker Chris Hubbard (blog coming soon? it&#8217;s here!) showed me a cool Vista feature.  I typically keep my Taskbar 2 rows tall. One for my applications, and one for my Quick Launch toolbar.  Many people think I&#8217;m nuts, since even I can&#8217;t always remember what all the icons are, but [...]]]></description>
			<content:encoded><![CDATA[<p>My friend and coworker <a href="http://www.thehubbards.org/blog/">Chris Hubbard</a> (<strike>blog coming soon?</strike> it&#8217;s here!) showed me a cool Vista feature.  I typically keep my Taskbar 2 rows tall. One for my applications, and one for my Quick Launch toolbar.  Many people think I&#8217;m nuts, since even I can&#8217;t always remember what all the icons are, but more often than not I still find it easier to launch an application that way over searching the start menu&#8211;when my hand is already on the mouse, that is.  I used <a href="http://www.bayden.com/SlickRun/">Bayden SlickRun</a> on my XP machine a lot, and loved it, but I just haven&#8217;t customized my Vista machine as much yet.  Of course with the searchable start menu SlickRun loses a bit of it&#8217;s pizazz.  And, as a mini-bonus, my clock shows the time, day of week, and date, which can be handy.</p>
<p><a href="http://www.aaronlerch.com/files/blog/VistaQuickLaunchHotkeys_E9DD/image02.png" atomicselection="true"><img src="http://www.aaronlerch.com/files/blog/VistaQuickLaunchHotkeys_E9DD/image0_thumb.png" style="border-width: 0px" border="0" height="61" width="474" /></a></p>
<p>But I digress.  In Vista by default you can activate the Win+# hotkeys to activate the Quick Launch shortcut in the specified location (1-based, so 0 == 10).  In my screenshot above, Win+1 opens <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx">PowerShell</a>, and Win+8 opens <a href="http://www.aisto.com/roeder/dotnet/">Reflector</a>.  As you reorder the shortcuts (you can drag and drop them to reorder) the hotkeys open the new shortcuts.</p>
<p>Very cool!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2007/05/17/vista-quick-launch-hotkeys/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Firefox Tip</title>
		<link>http://www.aaronlerch.com/blog/2006/09/11/firefox-tip/</link>
		<comments>http://www.aaronlerch.com/blog/2006/09/11/firefox-tip/#comments</comments>
		<pubDate>Mon, 11 Sep 2006 02:13:00 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2006/09/11/firefox-tip/</guid>
		<description><![CDATA[This is probably so ridiculous it’s just silly.
As I read a blog entry or a web site I will open interesting links in a new tab within Firefox. That way I can read uninterrupted but still have the relevant links available as soon as I’m done.  
For example, if I want to know who [...]]]></description>
			<content:encoded><![CDATA[<p>This is probably so ridiculous it’s just silly.</p>
<p>As I read a blog entry or a web site I will open interesting links in a new tab within Firefox. That way I can read uninterrupted but still have the relevant links available as soon as I’m done.  <img src="http://www.aaronlerch.com/files/blog/firefox_2Dcontext_2Dmenu.gif" alt="Firefox-context-menu" align="right" border="0" /></p>
<p>For example, if I want to know who <a href="http://www.hanselman.com/blog">Scott Hanselman</a> respects, and I do, I have the preference set to open the link in a new tab, however it immediately gives the tab focus—sort of making the whole idea of “don’t interrupt me” a moot point.  So I got in the habit of right-clicking and choosing “Open Link in New Tab” which opens a new tab but doesn’t steal the focus. But all that right-clicking gets old pretty fast.</p>
<p>So what’s the tip? If you click on a link with your scroll-wheel, it’s the same as right-clicking and choosing “Open Link in New Tab”!  Problem solved!  Didn’t I say this is ridiculously silly? Yep.  But it’s 2 AM and I should&#8217;ve been in bed hours ago.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2006/09/11/firefox-tip/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Helpful summary of string formatting (using C#)</title>
		<link>http://www.aaronlerch.com/blog/2006/03/07/helpful-summary-of-string-formatting-using-c/</link>
		<comments>http://www.aaronlerch.com/blog/2006/03/07/helpful-summary-of-string-formatting-using-c/#comments</comments>
		<pubDate>Tue, 07 Mar 2006 12:21:00 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2006/03/07/helpful-summary-of-string-formatting-using-c/</guid>
		<description><![CDATA[http://blog.stevex.net/index.php/string-formatting-in-csharp/
Helpful!
]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.stevex.net/index.php/string-formatting-in-csharp/">http://blog.stevex.net/index.php/string-formatting-in-csharp/</a></p>
<p>Helpful!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2006/03/07/helpful-summary-of-string-formatting-using-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
