<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>This Old Code - VB</title>
    <link>http://thisoldcode.net/</link>
    <description>(Architecture + Development) ^ Testing = Product </description>
    <language>en-us</language>
    <copyright>Aaron Fischer</copyright>
    <lastBuildDate>Thu, 26 Jun 2008 16:46:38 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>aaron@microfisch.com</managingEditor>
    <webMaster>aaron@microfisch.com</webMaster>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=fecbe26b-f9f2-4b43-a2e0-685240b8f0c5</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,fecbe26b-f9f2-4b43-a2e0-685240b8f0c5.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,fecbe26b-f9f2-4b43-a2e0-685240b8f0c5.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=fecbe26b-f9f2-4b43-a2e0-685240b8f0c5</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I am starting to suspect VB.net 2008 is not saving all my changes.  This is not
a good sign.  Maybe this will be fixed in SP1.  I hope a lot of my VB headaches
will go a way with SP1
</p>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=fecbe26b-f9f2-4b43-a2e0-685240b8f0c5" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>Visual Basic</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,fecbe26b-f9f2-4b43-a2e0-685240b8f0c5.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,fecbe26b-f9f2-4b43-a2e0-685240b8f0c5.aspx</link>
      <pubDate>Thu, 26 Jun 2008 16:46:38 GMT</pubDate>
      <description>&lt;p&gt;
I am starting to suspect VB.net 2008 is not saving all my changes.&amp;nbsp; This is not
a good sign.&amp;nbsp; Maybe this will be fixed in SP1.&amp;nbsp; I hope a lot of my VB headaches
will go a way with SP1
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=fecbe26b-f9f2-4b43-a2e0-685240b8f0c5" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,fecbe26b-f9f2-4b43-a2e0-685240b8f0c5.aspx</comments>
      <category>VB</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=d676478c-a7a3-4933-a6ac-dcd3ef1c2c48</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,d676478c-a7a3-4933-a6ac-dcd3ef1c2c48.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,d676478c-a7a3-4933-a6ac-dcd3ef1c2c48.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=d676478c-a7a3-4933-a6ac-dcd3ef1c2c48</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was looking for a way to pass a parameter by reference today.  More specifically
the setter.
</p>
        <p>
I found a couple interesting blog posts
</p>
        <p>
          <a title="http://geekswithblogs.net/akraus1/archive/2006/02/10/69047.aspx" href="http://geekswithblogs.net/akraus1/archive/2006/02/10/69047.aspx">http://geekswithblogs.net/akraus1/archive/2006/02/10/69047.aspx</a>
        </p>
        <p>
notice the comment by Tedesco.
</p>
        <p>
He offers a nice way to do this via an anonymous delegate.
</p>
        <p>
        </p>
        <pre class="code">
          <span style="color: rgb(222, 222, 203);">
            <span style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">
            </span>
            <span style="color: rgb(91, 105, 106);">public</span>
            <span style="color: rgb(222, 222, 203);">
            </span>
            <span style="color: rgb(91, 105, 106);">delegate</span>
            <span style="color: rgb(222, 222, 203);">
            </span>
            <span style="color: rgb(91, 105, 106);">void</span>
            <span style="color: rgb(222, 222, 203);">
            </span>
            <span style="color: rgb(140, 0, 84);">InsertString</span>
            <span style="color: rgb(222, 222, 203);">( </span>
            <span style="color: rgb(201, 199, 167);">System</span>
            <span style="color: rgb(150, 120, 120);">.</span>
            <span style="color: rgb(121, 151, 84);">String</span>
            <span style="color: rgb(222, 222, 203);">
            </span>
            <span style="color: rgb(201, 199, 167);">param</span>
            <span style="color: rgb(222, 222, 203);"> );<br /></span>
            <span style="color: rgb(91, 105, 106);">public</span>
            <span style="color: rgb(222, 222, 203);">
            </span>
            <span style="color: rgb(91, 105, 106);">partial</span>
            <span style="color: rgb(222, 222, 203);">
            </span>
            <span style="color: rgb(91, 105, 106);">class</span>
            <span style="color: rgb(222, 222, 203);">
            </span>
            <span style="color: rgb(121, 151, 84);">Bird<br /></span>
            <span style="color: rgb(222, 222, 203);"> {<br /></span>
            <span style="color: rgb(91, 105, 106);">public</span>
            <span style="color: rgb(222, 222, 203);">
            </span>
            <span style="color: rgb(91, 105, 106);">void</span>
            <span style="color: rgb(222, 222, 203);">
            </span>
            <span style="color: rgb(201, 199, 167);">FileToDb</span>
            <span style="color: rgb(222, 222, 203);">( </span>
            <span style="color: rgb(91, 105, 106);">int</span>
            <span style="color: rgb(222, 222, 203);">
            </span>
            <span style="color: rgb(201, 199, 167);">x</span>
            <span style="color: rgb(222, 222, 203);"> )<br />
{<br /></span>
            <span style="color: rgb(201, 199, 167);">FillEntityColumn</span>
            <span style="color: rgb(222, 222, 203);">( </span>
            <span style="color: rgb(91, 105, 106);">delegate</span>
            <span style="color: rgb(222, 222, 203);">( </span>
            <span style="color: rgb(201, 199, 167);">System</span>
            <span style="color: rgb(150, 120, 120);">.</span>
            <span style="color: rgb(121, 151, 84);">String</span>
            <span style="color: rgb(222, 222, 203);">
            </span>
            <span style="color: rgb(201, 199, 167);">value</span>
            <span style="color: rgb(222, 222, 203);"> )<br />
{<br /></span>
            <span style="color: rgb(201, 199, 167);">tExtra</span>
            <span style="color: rgb(150, 120, 120);">.</span>
            <span style="color: rgb(201, 199, 167);">Text</span>
            <span style="color: rgb(222, 222, 203);">
            </span>
            <span style="color: rgb(150, 120, 120);">=</span>
            <span style="color: rgb(222, 222, 203);">
            </span>
            <span style="color: rgb(201, 199, 167);">value</span>
            <span style="color: rgb(222, 222, 203);">;<br />
} );<br />
}<br />
} </span>
          </span>
        </pre>
        <a href="http://11011.net/software/vspaste">
        </a>
        <p>
So we actual pass the FillEntityColumn method an anonymous delegate which then sets
the property.
</p>
Now in vb you can write<p></p><pre class="code"><span style="color: rgb(222, 222, 203);"><span style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"></span><span style="color: rgb(91, 105, 106);">Private</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">Sub</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">Button1_Click</span><span style="color: rgb(222, 222, 203);">(</span><span style="color: rgb(91, 105, 106);">ByVal</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">sender</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">As</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">System</span><span style="color: rgb(222, 222, 203);">.Object, </span><span style="color: rgb(91, 105, 106);">ByVal</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">e</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">As</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">System</span><span style="color: rgb(222, 222, 203);">.</span><span style="color: rgb(201, 199, 167);">EventArgs</span><span style="color: rgb(222, 222, 203);">) </span><span style="color: rgb(91, 105, 106);">Handles</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">Button1</span><span style="color: rgb(222, 222, 203);">.</span><span style="color: rgb(201, 199, 167);">Click<br /><br /></span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">testme</span><span style="color: rgb(222, 222, 203);">(</span><span style="color: rgb(201, 199, 167);">TextBox1</span><span style="color: rgb(222, 222, 203);">.</span><span style="color: rgb(201, 199, 167);">Text</span><span style="color: rgb(222, 222, 203);">)<br /></span><span style="color: rgb(91, 105, 106);">End</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">Sub<br /></span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">Sub</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">testme</span><span style="color: rgb(222, 222, 203);">(</span><span style="color: rgb(91, 105, 106);">ByRef</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">s</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">As</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">String</span><span style="color: rgb(222, 222, 203);">)<br /></span><span style="color: rgb(201, 199, 167);">s</span><span style="color: rgb(222, 222, 203);"> = </span><span style="color: rgb(140, 112, 80);">"hello"<br /></span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">End</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">Sub<br /></span></span></pre><a href="http://11011.net/software/vspaste"></a><p>
which a commenter on <a title="http://musingmarc.blogspot.com/2006/04/tale-of-two-implementations.html" href="http://musingmarc.blogspot.com/2006/04/tale-of-two-implementations.html">http://musingmarc.blogspot.com/2006/04/tale-of-two-implementations.html</a> eluded
to.  But in vb you still cannot pass a Property by reference, at least not really.  Take
a look what vb generates into il.
</p><pre class="code"><span style="color: rgb(222, 222, 203);"><span style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"></span><span style="color: rgb(91, 105, 106);">Private</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">Sub</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">Button1_Click</span><span style="color: rgb(222, 222, 203);">(</span><span style="color: rgb(91, 105, 106);">ByVal</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">sender</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">As</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">Object</span><span style="color: rgb(222, 222, 203);">, </span><span style="color: rgb(91, 105, 106);">ByVal</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">e</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">As</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">EventArgs</span><span style="color: rgb(222, 222, 203);">)<br /></span><span style="color: rgb(91, 105, 106);">Dim</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">VB$t_ref$S0</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">As</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">TextBox</span><span style="color: rgb(222, 222, 203);"> = </span><span style="color: rgb(91, 105, 106);">Me</span><span style="color: rgb(222, 222, 203);">.</span><span style="color: rgb(201, 199, 167);">TextBox1<br /></span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">Dim</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(201, 199, 167);">VB$t_string$S0</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">As</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">String</span><span style="color: rgb(222, 222, 203);"> = </span><span style="color: rgb(201, 199, 167);">VB$t_ref$S0</span><span style="color: rgb(222, 222, 203);">.</span><span style="color: rgb(201, 199, 167);">Text<br /></span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">Me</span><span style="color: rgb(222, 222, 203);">.</span><span style="color: rgb(201, 199, 167);">testme</span><span style="color: rgb(222, 222, 203);">((</span><span style="color: rgb(201, 199, 167);">VB$t_string$S0</span><span style="color: rgb(222, 222, 203);">))<br /></span><span style="color: rgb(201, 199, 167);">VB$t_ref$S0</span><span style="color: rgb(222, 222, 203);">.</span><span style="color: rgb(201, 199, 167);">Text</span><span style="color: rgb(222, 222, 203);"> = </span><span style="color: rgb(201, 199, 167);">VB$t_string$S0<br /></span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">End</span><span style="color: rgb(222, 222, 203);"></span><span style="color: rgb(91, 105, 106);">Sub<br /></span></span></pre><a href="http://11011.net/software/vspaste"></a> As you can see vb is writing some
code for you which is nice, but we are still not passing the property by ref. 
<br />
   -<a href="http://blogs.msdn.com/jmstall/archive/2006/02/09/property-by-Ref.aspx">Mike
has also talked about the want of passing parameters</a>. ( the same misguided comment
that vb supports passing parameters by ref)<br /><img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=d676478c-a7a3-4933-a6ac-dcd3ef1c2c48" /><br /><hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>Setting a property via anonymous delegates</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,d676478c-a7a3-4933-a6ac-dcd3ef1c2c48.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,d676478c-a7a3-4933-a6ac-dcd3ef1c2c48.aspx</link>
      <pubDate>Wed, 25 Jul 2007 19:27:21 GMT</pubDate>
      <description>&lt;p&gt;
I was looking for a way to pass a parameter by reference today.&amp;nbsp; More specifically
the setter.
&lt;/p&gt;
&lt;p&gt;
I found a couple interesting blog posts
&lt;/p&gt;
&lt;p&gt;
&lt;a title="http://geekswithblogs.net/akraus1/archive/2006/02/10/69047.aspx" href="http://geekswithblogs.net/akraus1/archive/2006/02/10/69047.aspx"&gt;http://geekswithblogs.net/akraus1/archive/2006/02/10/69047.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
notice the comment by Tedesco.
&lt;/p&gt;
&lt;p&gt;
He offers a nice way to do this via an anonymous delegate.
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;&lt;span style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;public&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;delegate&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;void&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(140, 0, 84);"&gt;InsertString&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;( &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;System&lt;/span&gt;&lt;span style="color: rgb(150, 120, 120);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(121, 151, 84);"&gt;String&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;param&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; );&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;public&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;partial&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;class&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(121, 151, 84);"&gt;Bird&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; {&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;public&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;void&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;FileToDb&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;( &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;int&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;x&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; )&lt;br&gt;
{&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;FillEntityColumn&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;( &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;delegate&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;( &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;System&lt;/span&gt;&lt;span style="color: rgb(150, 120, 120);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(121, 151, 84);"&gt;String&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;value&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; )&lt;br&gt;
{&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;tExtra&lt;/span&gt;&lt;span style="color: rgb(150, 120, 120);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;Text&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(150, 120, 120);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;value&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;;&lt;br&gt;
} );&lt;br&gt;
}&lt;br&gt;
} &lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt; 
&lt;p&gt;
So we actual pass the FillEntityColumn method an anonymous delegate which then sets
the property.
&lt;/p&gt;
Now in vb you can write&lt;p&gt;
&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;&lt;span style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;Private&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;Sub&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;Button1_Click&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;ByVal&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;sender&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;As&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;System&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;.Object, &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;ByVal&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;e&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;As&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;System&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;EventArgs&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;) &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;Handles&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;Button1&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;Click&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;testme&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;TextBox1&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;Text&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;)&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;End&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;Sub&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;Sub&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;testme&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;ByRef&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;s&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;As&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;String&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;)&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;s&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; = &lt;/span&gt;&lt;span style="color: rgb(140, 112, 80);"&gt;"hello"&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;End&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;Sub&lt;br&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt; 
&lt;p&gt;
which a commenter on &lt;a title="http://musingmarc.blogspot.com/2006/04/tale-of-two-implementations.html" href="http://musingmarc.blogspot.com/2006/04/tale-of-two-implementations.html"&gt;http://musingmarc.blogspot.com/2006/04/tale-of-two-implementations.html&lt;/a&gt;&amp;nbsp;eluded
to.&amp;nbsp; But in vb you still cannot pass a Property by reference, at least not really.&amp;nbsp;&amp;nbsp;Take
a look what&amp;nbsp;vb generates into il.
&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;&lt;span style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;Private&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;Sub&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;Button1_Click&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;ByVal&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;sender&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;As&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;Object&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;ByVal&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;e&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;As&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;EventArgs&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;)&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;Dim&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;VB$t_ref$S0&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;As&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;TextBox&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; = &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;Me&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;TextBox1&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;Dim&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;VB$t_string$S0&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;As&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;String&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; = &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;VB$t_ref$S0&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;Text&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;Me&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;testme&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;((&lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;VB$t_string$S0&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;))&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;VB$t_ref$S0&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;Text&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; = &lt;/span&gt;&lt;span style="color: rgb(201, 199, 167);"&gt;VB$t_string$S0&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;End&lt;/span&gt;&lt;span style="color: rgb(222, 222, 203);"&gt; &lt;/span&gt;&lt;span style="color: rgb(91, 105, 106);"&gt;Sub&lt;br&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt; As you can see vb is writing some
code for you which is nice, but we are still not passing the&amp;nbsp;property by&amp;nbsp;ref. 
&lt;br&gt;
&amp;nbsp;&amp;nbsp; -&lt;a href="http://blogs.msdn.com/jmstall/archive/2006/02/09/property-by-Ref.aspx"&gt;Mike
has also talked about the want of passing parameters&lt;/a&gt;. ( the same misguided comment
that vb supports passing parameters by ref)&lt;br&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=d676478c-a7a3-4933-a6ac-dcd3ef1c2c48" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,d676478c-a7a3-4933-a6ac-dcd3ef1c2c48.aspx</comments>
      <category>CSharp</category>
      <category>DotNet</category>
      <category>VB</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=1055c19f-d367-44b3-add0-c58a274f0fff</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,1055c19f-d367-44b3-add0-c58a274f0fff.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,1055c19f-d367-44b3-add0-c58a274f0fff.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=1055c19f-d367-44b3-add0-c58a274f0fff</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Scott posted a nice article <a href="http://weblogs.asp.net/scottgu/archive/2007/06/15/tip-trick-creating-packaged-asp-net-setup-programs-with-vs-2005.aspx">Tip/Trick:
Creating Packaged ASP.NET Setup Programs with VS 2005</a>  for deploying your
Visual Studio 2005 project.  While Scott's article is focused on deploying to
a customer I have found those scenarios to be beyond what VS offers and requires Install
shield.  I do this this post is a handy trick for moving your project from dev
to QA to staging maybe even production.
</p>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=1055c19f-d367-44b3-add0-c58a274f0fff" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>Packaged ASP.NET Programs</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,1055c19f-d367-44b3-add0-c58a274f0fff.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,1055c19f-d367-44b3-add0-c58a274f0fff.aspx</link>
      <pubDate>Fri, 15 Jun 2007 22:02:29 GMT</pubDate>
      <description>&lt;p&gt;
Scott posted a nice article &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/06/15/tip-trick-creating-packaged-asp-net-setup-programs-with-vs-2005.aspx"&gt;Tip/Trick:
Creating Packaged ASP.NET Setup Programs with VS 2005&lt;/a&gt;&amp;nbsp; for deploying your
Visual Studio 2005 project.&amp;nbsp; While Scott's article is focused on deploying to
a customer I have found those scenarios to be beyond what VS offers and requires Install
shield.&amp;nbsp; I do this this post is a handy trick for moving your project from dev
to QA to staging maybe even production.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=1055c19f-d367-44b3-add0-c58a274f0fff" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,1055c19f-d367-44b3-add0-c58a274f0fff.aspx</comments>
      <category>ASP.NET</category>
      <category>CSharp</category>
      <category>DotNet</category>
      <category>Microsoft</category>
      <category>VB</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=9e078407-18df-43be-a986-a1e261d07f3e</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,9e078407-18df-43be-a986-a1e261d07f3e.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,9e078407-18df-43be-a986-a1e261d07f3e.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=9e078407-18df-43be-a986-a1e261d07f3e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
Erika wrote a couple posts worth a look regarding Data driven document generation.
</p>
        <p>
          <a href="http://blogs.msdn.com/erikaehrli/archive/2006/08/11/word2007DataDocumentGenerationPart1.aspx">Data-driven
document generation with Word 2007 and the Office XML File Formats: Part 1</a>
        </p>
        <p>
        </p>
        <p>
          <a href="http://blogs.msdn.com/erikaehrli/archive/2006/08/16/word2007DataDocumentGenerationPart2.aspx">Data-driven
document generation with Word 2007 and the Office XML File Formats: Part 2</a>
        </p>
        <p>
        </p>
        <p>
Also If you wanted to take a Mail Merge word doc and port it over to XML 
</p>
        <p>
          <a href="http://blogs.msdn.com/microsoft_office_word/archive/2007/03/28/migrating-mail-merge-fields-to-content-controls.aspx" target="_blank">Migrating
Mail Merge Fields to Content Controls</a> ( I republished the code so that its
legible)
</p>
        <p>
 
</p>
        <blockquote>
          <pre class="csharpcode">
            <span class="kwrd">Private</span>
            <span class="kwrd">Sub</span> Document_Open() <span class="kwrd">If</span> (MsgBox(<span class="str">"Convert
Mail Merge fields to Content Controls?"</span>, vbYesNo, <span class="str">"Convert
Mail Merge Fields"</span>) = vbYes) <span class="kwrd">Then</span> ConvertMailMergeFields <span class="kwrd">End</span><span class="kwrd">If</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="rem">'**
Traverse Mail Merge fields collection and convert each mail merge field into a content
control</span><span class="rem">'** while preserving its font style and format.</span><span class="kwrd">Private</span><span class="kwrd">Sub</span> ConvertMailMergeFields() <span class="kwrd">Dim</span> i <span class="kwrd">As</span><span class="kwrd">Integer</span>,
Count <span class="kwrd">As</span><span class="kwrd">Integer</span><span class="kwrd">Dim</span> currentFont <span class="kwrd">As</span> Font <span class="kwrd">Dim</span> mergeFieldname <span class="kwrd">As</span><span class="kwrd">String</span><span class="kwrd">Dim</span> field <span class="kwrd">As</span> MailMergeField <span class="kwrd">For</span><span class="kwrd">Each</span> field <span class="kwrd">In</span> ActiveDocument.MailMerge.Fields <span class="rem">'**
Select Mail Merge field to process.</span> field.<span class="kwrd">Select</span><span class="kwrd">Set</span> currentFont
= Selection.Font <span class="rem">'** Set name for content control.</span> mergeFieldname
= GetMailMergeFieldName(field.Code) Debug.Print (<span class="str">"Processing ["</span> &amp;
mergeFieldname &amp; <span class="str">"]"</span>) <span class="rem">'** Remove Mail
Merge field and replace it with addition of new content control.</span> Selection.Cut <span class="rem">'**
Add new content control.</span> AddContentControl mergeFieldname, currentFont Count
= Count + 1 <span class="kwrd">Next</span> Debug.Print (<span class="str">"Number
of Mail Merge Fields converted to Content Controls: "</span> &amp; Count) <span class="kwrd">End</span><span class="kwrd">Sub</span><span class="rem">'**
Add new content control.</span><span class="kwrd">Private</span><span class="kwrd">Sub</span> AddContentControl(<span class="kwrd">ByVal</span> mergeFieldname <span class="kwrd">As</span><span class="kwrd">String</span>, <span class="kwrd">ByVal</span> currentFont <span class="kwrd">As</span> Font) <span class="kwrd">Dim</span> newControl <span class="kwrd">As</span> ContentControl <span class="kwrd">Dim</span> fontStyleName <span class="kwrd">As</span><span class="kwrd">String</span><span class="kwrd">Set</span> newControl
= ActiveDocument.ContentControls.Add(wdContentControlText) <span class="rem">'** The
Title property only allows for 64 characters.</span><span class="rem">'** If name
is longer, we will put the rest in the Tag property.</span><span class="kwrd">If</span> (Len(mergeFieldname)
&lt; 64) <span class="kwrd">Then</span> newControl.Title = mergeFieldname newControl.Tag
= <span class="str">""</span><span class="kwrd">Else</span> newControl.Title = Mid(mergeFieldname,
1, 64) newControl.Tag = Mid(mergeFieldname, 65, Len(mergeFieldname) - 64) <span class="kwrd">End</span><span class="kwrd">If</span> newControl.SetPlaceholderText
, , <span class="str">"Click to add."</span><span class="rem">'** Set font for content
control.</span> fontStyleName = GetFontStyleName(currentFont) SetFontStyle newControl,
fontStyleName, currentFont <span class="rem">'** Allow carriage return.</span> newControl.MultiLine
= <span class="kwrd">True</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="rem">'**
Quick and dirty way to check to see if the given font style exist; if it does not,
create it.</span><span class="kwrd">Private</span><span class="kwrd">Sub</span> SetFontStyle(<span class="kwrd">ByRef</span> newControl <span class="kwrd">As</span> ContentControl, <span class="kwrd">ByVal</span> fontStyleName <span class="kwrd">As</span><span class="kwrd">String</span>, <span class="kwrd">ByVal</span> currentFont <span class="kwrd">As</span> Font) <span class="kwrd">On</span><span class="kwrd">Error</span><span class="kwrd">GoTo</span> Error_FontStyleDoesNotExist
newControl.DefaultTextStyle = fontStyleName <span class="kwrd">Exit</span><span class="kwrd">Sub</span> Error_FontStyleDoesNotExist:
AddNewFontStyle fontStyleName, currentFont newControl.DefaultTextStyle = fontStyleName <span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Private</span><span class="kwrd">Sub</span> AddNewFontStyle(<span class="kwrd">ByVal</span> newFontStyleName <span class="kwrd">As</span><span class="kwrd">String</span>, <span class="kwrd">ByVal</span> currentFont <span class="kwrd">As</span> Font) <span class="kwrd">Dim</span> fontStyle <span class="kwrd">As</span> Style <span class="kwrd">Set</span> fontStyle
= ActiveDocument.Styles.Add(newFontStyleName) <span class="kwrd">With</span> currentFont
fontStyle.Font.Name = .Name fontStyle.Font.Size = .Size fontStyle.Font.Bold = .Bold
fontStyle.Font.Italic = .Italic <span class="kwrd">End</span><span class="kwrd">With</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Private</span><span class="kwrd">Function</span> GetFontStyleName(<span class="kwrd">ByVal</span> currentFont <span class="kwrd">As</span> Font) <span class="kwrd">As</span><span class="kwrd">String</span><span class="kwrd">Dim</span> fontStyleName <span class="kwrd">As</span><span class="kwrd">String</span><span class="kwrd">With</span> currentFont
fontStyleName = .Name fontStyleName = fontStyleName &amp; .Size fontStyleName = fontStyleName
&amp; .Bold fontStyleName = fontStyleName &amp; .Italic <span class="kwrd">End</span><span class="kwrd">With</span><span class="rem">'**
Return result.</span> GetFontStyleName = fontStyleName <span class="kwrd">End</span><span class="kwrd">Function</span><span class="kwrd">Private</span><span class="kwrd">Function</span> GetMailMergeFieldName(<span class="kwrd">ByVal</span> fieldCode <span class="kwrd">As</span><span class="kwrd">String</span>) <span class="kwrd">As</span><span class="kwrd">String</span><span class="kwrd">Dim</span> mergeFieldname <span class="kwrd">As</span><span class="kwrd">String</span>:
mergeFieldname = <span class="str">""</span><span class="rem">'** Name of Mail merge
field: MERGEFIELD MailMergeFieldName \* MERGEFORMAT</span> mergeFieldname = Replace(fieldCode, <span class="str">"MERGEFIELD"</span>, <span class="str">""</span>)
mergeFieldname = Replace(mergeFieldname, <span class="str">"\* MERGEFORMAT"</span>, <span class="str">""</span>)
mergeFieldname = Trim(mergeFieldname) <span class="rem">'** Return result.</span> GetMailMergeFieldName
= mergeFieldname <span class="kwrd">End</span> Function</pre>
        </blockquote>
        <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>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=9e078407-18df-43be-a986-a1e261d07f3e" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>Data driven document generation with Word 2007</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,9e078407-18df-43be-a986-a1e261d07f3e.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,9e078407-18df-43be-a986-a1e261d07f3e.aspx</link>
      <pubDate>Tue, 29 May 2007 15:36:12 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Erika wrote a couple posts worth a look regarding Data driven document generation.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blogs.msdn.com/erikaehrli/archive/2006/08/11/word2007DataDocumentGenerationPart1.aspx"&gt;Data-driven
document generation with Word 2007 and the Office XML File Formats: Part 1&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blogs.msdn.com/erikaehrli/archive/2006/08/16/word2007DataDocumentGenerationPart2.aspx"&gt;Data-driven
document generation with Word 2007 and the Office XML File Formats: Part 2&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Also If you wanted to take a Mail Merge word doc and port it over to XML 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blogs.msdn.com/microsoft_office_word/archive/2007/03/28/migrating-mail-merge-fields-to-content-controls.aspx" target="_blank"&gt;Migrating
Mail Merge Fields to Content Controls&lt;/a&gt;&amp;nbsp;( I republished the code so that its
legible)
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;blockquote&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; Document_Open() &lt;span class="kwrd"&gt;If&lt;/span&gt; (MsgBox(&lt;span class="str"&gt;"Convert
Mail Merge fields to Content Controls?"&lt;/span&gt;, vbYesNo, &lt;span class="str"&gt;"Convert
Mail Merge Fields"&lt;/span&gt;) = vbYes) &lt;span class="kwrd"&gt;Then&lt;/span&gt; ConvertMailMergeFields &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="rem"&gt;'**
Traverse Mail Merge fields collection and convert each mail merge field into a content
control&lt;/span&gt; &lt;span class="rem"&gt;'** while preserving its font style and format.&lt;/span&gt; &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; ConvertMailMergeFields() &lt;span class="kwrd"&gt;Dim&lt;/span&gt; i &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;,
Count &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; currentFont &lt;span class="kwrd"&gt;As&lt;/span&gt; Font &lt;span class="kwrd"&gt;Dim&lt;/span&gt; mergeFieldname &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; field &lt;span class="kwrd"&gt;As&lt;/span&gt; MailMergeField &lt;span class="kwrd"&gt;For&lt;/span&gt; &lt;span class="kwrd"&gt;Each&lt;/span&gt; field &lt;span class="kwrd"&gt;In&lt;/span&gt; ActiveDocument.MailMerge.Fields &lt;span class="rem"&gt;'**
Select Mail Merge field to process.&lt;/span&gt; field.&lt;span class="kwrd"&gt;Select&lt;/span&gt; &lt;span class="kwrd"&gt;Set&lt;/span&gt; currentFont
= Selection.Font &lt;span class="rem"&gt;'** Set name for content control.&lt;/span&gt; mergeFieldname
= GetMailMergeFieldName(field.Code) Debug.Print (&lt;span class="str"&gt;"Processing ["&lt;/span&gt; &amp;amp;
mergeFieldname &amp;amp; &lt;span class="str"&gt;"]"&lt;/span&gt;) &lt;span class="rem"&gt;'** Remove Mail
Merge field and replace it with addition of new content control.&lt;/span&gt; Selection.Cut &lt;span class="rem"&gt;'**
Add new content control.&lt;/span&gt; AddContentControl mergeFieldname, currentFont Count
= Count + 1 &lt;span class="kwrd"&gt;Next&lt;/span&gt; Debug.Print (&lt;span class="str"&gt;"Number
of Mail Merge Fields converted to Content Controls: "&lt;/span&gt; &amp;amp; Count) &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="rem"&gt;'**
Add new content control.&lt;/span&gt; &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; AddContentControl(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; mergeFieldname &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; currentFont &lt;span class="kwrd"&gt;As&lt;/span&gt; Font) &lt;span class="kwrd"&gt;Dim&lt;/span&gt; newControl &lt;span class="kwrd"&gt;As&lt;/span&gt; ContentControl &lt;span class="kwrd"&gt;Dim&lt;/span&gt; fontStyleName &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt; &lt;span class="kwrd"&gt;Set&lt;/span&gt; newControl
= ActiveDocument.ContentControls.Add(wdContentControlText) &lt;span class="rem"&gt;'** The
Title property only allows for 64 characters.&lt;/span&gt; &lt;span class="rem"&gt;'** If name
is longer, we will put the rest in the Tag property.&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt; (Len(mergeFieldname)
&amp;lt; 64) &lt;span class="kwrd"&gt;Then&lt;/span&gt; newControl.Title = mergeFieldname newControl.Tag
= &lt;span class="str"&gt;""&lt;/span&gt; &lt;span class="kwrd"&gt;Else&lt;/span&gt; newControl.Title = Mid(mergeFieldname,
1, 64) newControl.Tag = Mid(mergeFieldname, 65, Len(mergeFieldname) - 64) &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt; newControl.SetPlaceholderText
, , &lt;span class="str"&gt;"Click to add."&lt;/span&gt; &lt;span class="rem"&gt;'** Set font for content
control.&lt;/span&gt; fontStyleName = GetFontStyleName(currentFont) SetFontStyle newControl,
fontStyleName, currentFont &lt;span class="rem"&gt;'** Allow carriage return.&lt;/span&gt; newControl.MultiLine
= &lt;span class="kwrd"&gt;True&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="rem"&gt;'**
Quick and dirty way to check to see if the given font style exist; if it does not,
create it.&lt;/span&gt; &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; SetFontStyle(&lt;span class="kwrd"&gt;ByRef&lt;/span&gt; newControl &lt;span class="kwrd"&gt;As&lt;/span&gt; ContentControl, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; fontStyleName &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; currentFont &lt;span class="kwrd"&gt;As&lt;/span&gt; Font) &lt;span class="kwrd"&gt;On&lt;/span&gt; &lt;span class="kwrd"&gt;Error&lt;/span&gt; &lt;span class="kwrd"&gt;GoTo&lt;/span&gt; Error_FontStyleDoesNotExist
newControl.DefaultTextStyle = fontStyleName &lt;span class="kwrd"&gt;Exit&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; Error_FontStyleDoesNotExist:
AddNewFontStyle fontStyleName, currentFont newControl.DefaultTextStyle = fontStyleName &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; AddNewFontStyle(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; newFontStyleName &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; currentFont &lt;span class="kwrd"&gt;As&lt;/span&gt; Font) &lt;span class="kwrd"&gt;Dim&lt;/span&gt; fontStyle &lt;span class="kwrd"&gt;As&lt;/span&gt; Style &lt;span class="kwrd"&gt;Set&lt;/span&gt; fontStyle
= ActiveDocument.Styles.Add(newFontStyleName) &lt;span class="kwrd"&gt;With&lt;/span&gt; currentFont
fontStyle.Font.Name = .Name fontStyle.Font.Size = .Size fontStyle.Font.Bold = .Bold
fontStyle.Font.Italic = .Italic &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;With&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; GetFontStyleName(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; currentFont &lt;span class="kwrd"&gt;As&lt;/span&gt; Font) &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; fontStyleName &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt; &lt;span class="kwrd"&gt;With&lt;/span&gt; currentFont
fontStyleName = .Name fontStyleName = fontStyleName &amp;amp; .Size fontStyleName = fontStyleName
&amp;amp; .Bold fontStyleName = fontStyleName &amp;amp; .Italic &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;With&lt;/span&gt; &lt;span class="rem"&gt;'**
Return result.&lt;/span&gt; GetFontStyleName = fontStyleName &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; GetMailMergeFieldName(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; fieldCode &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;) &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; mergeFieldname &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;:
mergeFieldname = &lt;span class="str"&gt;""&lt;/span&gt; &lt;span class="rem"&gt;'** Name of Mail merge
field: MERGEFIELD MailMergeFieldName \* MERGEFORMAT&lt;/span&gt; mergeFieldname = Replace(fieldCode, &lt;span class="str"&gt;"MERGEFIELD"&lt;/span&gt;, &lt;span class="str"&gt;""&lt;/span&gt;)
mergeFieldname = Replace(mergeFieldname, &lt;span class="str"&gt;"\* MERGEFORMAT"&lt;/span&gt;, &lt;span class="str"&gt;""&lt;/span&gt;)
mergeFieldname = Trim(mergeFieldname) &lt;span class="rem"&gt;'** Return result.&lt;/span&gt; GetMailMergeFieldName
= mergeFieldname &lt;span class="kwrd"&gt;End&lt;/span&gt; Function&lt;/pre&gt;
&lt;/blockquote&gt; &lt;style type="text/css"&gt;.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; }
&lt;/style&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=9e078407-18df-43be-a986-a1e261d07f3e" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,9e078407-18df-43be-a986-a1e261d07f3e.aspx</comments>
      <category>Microsoft</category>
      <category>VB</category>
      <category>XML</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=05a49754-3d61-4942-9f8b-544e1fadfe0d</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,05a49754-3d61-4942-9f8b-544e1fadfe0d.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,05a49754-3d61-4942-9f8b-544e1fadfe0d.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=05a49754-3d61-4942-9f8b-544e1fadfe0d</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
start by having a solution with two projects.
</p>
        <p>
          <a href="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B5%5D.png" atomicselection="true">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="240" src="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B4%5D.png" width="239" border="0" />
          </a>
        </p>
        <p>
In the solution exploder window right click the solution and choose add New or existing
item.
</p>
        <p>
          <a href="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B1%5D.png" atomicselection="true">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="200" src="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D.png" width="240" border="0" />
          </a>
        </p>
        <p>
 
</p>
        <p>
For this how two we will add a new c# class
</p>
        <p>
          <a href="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B3%5D.png" atomicselection="true">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="150" src="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B2%5D.png" width="240" border="0" />
          </a>
        </p>
        <p>
click add.  Visual studio will create a new suborder under the solution called
"Solution Items" Class1.cs will be in this folder.
</p>
        <p>
          <a href="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B7%5D.png" atomicselection="true">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="240" src="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B6%5D.png" width="210" border="0" />
          </a>
        </p>
        <p>
now select one of your projects and right click select add existing item.  Navigate
to your solutions directory and select Class1.cs
</p>
        <p>
click the drop down arrow next to the add button
</p>
        <p>
          <a href="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B13%5D.png" atomicselection="true">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="160" src="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B12%5D.png" width="240" border="0" />
          </a>
        </p>
        <p>
select add as link
</p>
        <p>
          <a href="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B15%5D.png" atomicselection="true">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="132" src="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B14%5D.png" width="240" border="0" />
          </a>
        </p>
        <p>
You will now have a shared link to a common solution file/class
</p>
        <p>
          <a href="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B17%5D.png" atomicselection="true">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="240" src="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B16%5D.png" width="179" border="0" />
          </a>
        </p>
        <p>
repeat for each project you wish to add this file/class to.
</p>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=05a49754-3d61-4942-9f8b-544e1fadfe0d" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>How-To share class/resources between projects in Visual Studio 2005</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,05a49754-3d61-4942-9f8b-544e1fadfe0d.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,05a49754-3d61-4942-9f8b-544e1fadfe0d.aspx</link>
      <pubDate>Fri, 18 May 2007 20:41:40 GMT</pubDate>
      <description>&lt;p&gt;
start by having a solution with two projects.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B5%5D.png" atomicselection="true"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="240" src="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B4%5D.png" width="239" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
In the solution exploder window right click the solution and choose add New or existing
item.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B1%5D.png" atomicselection="true"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="200" src="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D.png" width="240" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
For this how two we will add a new c# class
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B3%5D.png" atomicselection="true"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="150" src="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B2%5D.png" width="240" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
click add.&amp;nbsp; Visual studio will create a new suborder under the solution called
"Solution Items" Class1.cs will be in this folder.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B7%5D.png" atomicselection="true"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="240" src="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B6%5D.png" width="210" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
now select one of your projects and right click select add existing item.&amp;nbsp; Navigate
to your solutions directory and select Class1.cs
&lt;/p&gt;
&lt;p&gt;
click the drop down arrow next to the add button
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B13%5D.png" atomicselection="true"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="160" src="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B12%5D.png" width="240" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
select add as link
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B15%5D.png" atomicselection="true"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="132" src="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B14%5D.png" width="240" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
You will now have a shared link to a common solution file/class
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B17%5D.png" atomicselection="true"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="240" src="http://thisoldcode.microfisch.com/content/binary/WindowsLiveWriter/HowToshareclassresourcesbetweenprojectsi_C089/image%7B0%7D%5B16%5D.png" width="179" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
repeat for each project you wish to add this file/class to.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=05a49754-3d61-4942-9f8b-544e1fadfe0d" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,05a49754-3d61-4942-9f8b-544e1fadfe0d.aspx</comments>
      <category>CSharp</category>
      <category>DotNet</category>
      <category>Microsoft</category>
      <category>VB</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=586116c4-04fa-4be7-9ebb-4df95cbd141d</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,586116c4-04fa-4be7-9ebb-4df95cbd141d.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,586116c4-04fa-4be7-9ebb-4df95cbd141d.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=586116c4-04fa-4be7-9ebb-4df95cbd141d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
You can find the updated LINQ samples for both VB and C# <a href="http://msdn2.microsoft.com/en-us/vbasic/bb330936.aspx" target="_blank">here</a></p>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=586116c4-04fa-4be7-9ebb-4df95cbd141d" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>LINQ for Orcas Beta1</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,586116c4-04fa-4be7-9ebb-4df95cbd141d.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,586116c4-04fa-4be7-9ebb-4df95cbd141d.aspx</link>
      <pubDate>Fri, 20 Apr 2007 21:47:59 GMT</pubDate>
      <description>&lt;p&gt;
You can find the updated LINQ samples for both VB and C# &lt;a href="http://msdn2.microsoft.com/en-us/vbasic/bb330936.aspx" target="_blank"&gt;here&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=586116c4-04fa-4be7-9ebb-4df95cbd141d" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,586116c4-04fa-4be7-9ebb-4df95cbd141d.aspx</comments>
      <category>CSharp</category>
      <category>LINQ</category>
      <category>VB</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=91fedf3a-1be4-48c2-8250-8828f24536d6</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,91fedf3a-1be4-48c2-8250-8828f24536d6.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,91fedf3a-1be4-48c2-8250-8828f24536d6.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=91fedf3a-1be4-48c2-8250-8828f24536d6</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Incase you missed it yesterday Soma announced the <a href="http://blogs.msdn.com/somasegar/archive/2007/04/19/visual-studio-orcas-and-net-fx-3-5-beta1-shipped.aspx" target="_blank">release
of Orcas Beta 1,</a> it can be downloaded <a href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx" target="_blank">here</a>. 
</p>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=91fedf3a-1be4-48c2-8250-8828f24536d6" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>Beta 1 Of Orcas Released Into The Wild</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,91fedf3a-1be4-48c2-8250-8828f24536d6.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,91fedf3a-1be4-48c2-8250-8828f24536d6.aspx</link>
      <pubDate>Fri, 20 Apr 2007 21:43:03 GMT</pubDate>
      <description>&lt;p&gt;
Incase you missed it yesterday Soma announced the &lt;a href="http://blogs.msdn.com/somasegar/archive/2007/04/19/visual-studio-orcas-and-net-fx-3-5-beta1-shipped.aspx" target="_blank"&gt;release
of Orcas Beta 1,&lt;/a&gt; it can be downloaded &lt;a href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx" target="_blank"&gt;here&lt;/a&gt;. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=91fedf3a-1be4-48c2-8250-8828f24536d6" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,91fedf3a-1be4-48c2-8250-8828f24536d6.aspx</comments>
      <category>ASP.NET</category>
      <category>CSharp</category>
      <category>DotNet</category>
      <category>LINQ</category>
      <category>Microsoft</category>
      <category>VB</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=e69501c5-44f0-426d-9759-cda83baa4a20</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,e69501c5-44f0-426d-9759-cda83baa4a20.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,e69501c5-44f0-426d-9759-cda83baa4a20.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=e69501c5-44f0-426d-9759-cda83baa4a20</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I wanted to take a moment to point out my new favorite DotNet Function.  At VSLive
in San Francisco I was introduced to System.IO.Path.Combine( path1, path2) as string. 
I no longer have to deal with the logic of adding a trailing or leading slash when
combing  file and directory locations.
</p>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=e69501c5-44f0-426d-9759-cda83baa4a20" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>My New Favorite Function</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,e69501c5-44f0-426d-9759-cda83baa4a20.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,e69501c5-44f0-426d-9759-cda83baa4a20.aspx</link>
      <pubDate>Tue, 03 Apr 2007 16:27:05 GMT</pubDate>
      <description>&lt;p&gt;
I wanted to take a moment to point out my new favorite DotNet Function.&amp;nbsp; At VSLive
in San Francisco I was introduced to System.IO.Path.Combine( path1, path2) as string.&amp;nbsp;
I no longer have to deal with the logic of adding a trailing or leading slash when
combing&amp;nbsp; file and directory locations.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=e69501c5-44f0-426d-9759-cda83baa4a20" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,e69501c5-44f0-426d-9759-cda83baa4a20.aspx</comments>
      <category>CSharp</category>
      <category>DotNet</category>
      <category>VB</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=518254ba-7afb-4874-849f-3279d29497eb</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,518254ba-7afb-4874-849f-3279d29497eb.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,518254ba-7afb-4874-849f-3279d29497eb.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=518254ba-7afb-4874-849f-3279d29497eb</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I have finally found some programing books at my reading level ;)
</p>
        <p>
 
</p>
        <ul>
          <li>
            <a href="http://msdn.microsoft.com/vstudio/express/beginner/kids/csharp">C# for Sharp
Kids</a> - An ebook on programming with C# 
</li>
          <li>
            <a href="http://msdn.microsoft.com/vstudio/express/beginner/kids/vb">VB For Very Bright
Kids</a> - An ebook for learning how to programming with Visual Basic 
</li>
          <li>
            <a href="http://msdn.microsoft.com/coderules">Code Rules</a>
            <strong> -</strong> A
curriculum for learning how to program using Visual Basic. This package includes
Teacher materials, Student lessons and quizzes and has been used in schools around
the country. 
</li>
          <li>
            <b>
              <a href="http://msdn.microsoft.com/curlique">CurliQue Studios</a>
            </b> - A
curriculum for learning to build a dynamic web site for a rock band. This one also
includes teacher materials. My friend <a href="http://geekswithblogs.net/djacobus/archive/2007/02/23/107157.aspx">Dave
Jacobus blogs about using it</a> with his class and seems to like it. 
</li>
          <li>
            <b>
              <a href="http://msdn.microsoft.com/website">Creating your First Website using HTML</a> - </b>Follow
along with this Microsoft DigiGirlz Tech Camp presentation to learn how to use HTML
to create your own website! 
</li>
          <li>
A list of other kid friendly websites and learning resources.</li>
        </ul>
        <p>
Microsoft's <a href="http://msdn.microsoft.com/vstudio/express/beginner/kids/">Kid's
Corner</a></p>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=518254ba-7afb-4874-849f-3279d29497eb" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>Teach a child to program</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,518254ba-7afb-4874-849f-3279d29497eb.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,518254ba-7afb-4874-849f-3279d29497eb.aspx</link>
      <pubDate>Mon, 05 Mar 2007 14:52:03 GMT</pubDate>
      <description>&lt;p&gt;
I have finally found some programing books at my reading level ;)
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://msdn.microsoft.com/vstudio/express/beginner/kids/csharp"&gt;C# for Sharp
Kids&lt;/a&gt; - An ebook on programming with C# 
&lt;li&gt;
&lt;a href="http://msdn.microsoft.com/vstudio/express/beginner/kids/vb"&gt;VB For Very Bright
Kids&lt;/a&gt; - An ebook for learning how to programming with Visual Basic 
&lt;li&gt;
&lt;a href="http://msdn.microsoft.com/coderules"&gt;Code Rules&lt;/a&gt;&lt;strong&gt;&amp;nbsp;-&lt;/strong&gt; A
curriculum for&amp;nbsp;learning how to program using Visual Basic. This package includes
Teacher materials, Student lessons and quizzes and has been used in schools around
the country. 
&lt;li&gt;
&lt;b&gt;&lt;a href="http://msdn.microsoft.com/curlique"&gt;CurliQue Studios&lt;/a&gt;&lt;/b&gt;&amp;nbsp;- A
curriculum for learning to build a dynamic web site for a rock band. This one also
includes teacher materials. My friend &lt;a href="http://geekswithblogs.net/djacobus/archive/2007/02/23/107157.aspx"&gt;Dave
Jacobus blogs about using it&lt;/a&gt; with his class and seems to like it. 
&lt;li&gt;
&lt;b&gt;&lt;a href="http://msdn.microsoft.com/website"&gt;Creating your First Website using HTML&lt;/a&gt;&amp;nbsp;- &lt;/b&gt;Follow
along with this Microsoft DigiGirlz Tech Camp presentation to learn how to use HTML
to create your own website! 
&lt;li&gt;
A list of other kid friendly websites and learning resources.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Microsoft's &lt;a href="http://msdn.microsoft.com/vstudio/express/beginner/kids/"&gt;Kid's
Corner&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=518254ba-7afb-4874-849f-3279d29497eb" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,518254ba-7afb-4874-849f-3279d29497eb.aspx</comments>
      <category>CSharp</category>
      <category>DotNet</category>
      <category>Microsoft</category>
      <category>VB</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=eefb4db0-f1e6-4984-a7ba-725e0f8d60f7</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,eefb4db0-f1e6-4984-a7ba-725e0f8d60f7.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,eefb4db0-f1e6-4984-a7ba-725e0f8d60f7.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=eefb4db0-f1e6-4984-a7ba-725e0f8d60f7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I found another online <a href="http://codeconverter.sharpdevelop.net/Convert.aspx">code
converter</a> this time by <a href="http://sharpdevelop.com">SharpDevelop</a>. This
will convert between C#, VB,  and Boo.  They also have a <a href="http://codeconverter.sharpdevelop.net/ConvertService.asmx?op=PerformConversion">web
service</a>.<br /><br /><p></p><img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=eefb4db0-f1e6-4984-a7ba-725e0f8d60f7" /><br /><hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>Code Conversion Again</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,eefb4db0-f1e6-4984-a7ba-725e0f8d60f7.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,eefb4db0-f1e6-4984-a7ba-725e0f8d60f7.aspx</link>
      <pubDate>Sat, 17 Feb 2007 23:10:09 GMT</pubDate>
      <description>I found another online &lt;a href="http://codeconverter.sharpdevelop.net/Convert.aspx"&gt;code
converter&lt;/a&gt; this time by &lt;a href="http://sharpdevelop.com"&gt;SharpDevelop&lt;/a&gt;. This
will convert between C#, VB,&amp;nbsp; and Boo.&amp;nbsp; They also have a &lt;a href="http://codeconverter.sharpdevelop.net/ConvertService.asmx?op=PerformConversion"&gt;web
service&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=eefb4db0-f1e6-4984-a7ba-725e0f8d60f7" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,eefb4db0-f1e6-4984-a7ba-725e0f8d60f7.aspx</comments>
      <category>CSharp</category>
      <category>DotNet</category>
      <category>VB</category>
      <category>XML</category>
    </item>
  </channel>
</rss>