<?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>Points-of-Sharing</title>
	<atom:link href="http://vspug.com/dez/feed/" rel="self" type="application/rss+xml" />
	<link>http://vspug.com/dez</link>
	<description>Just another VSPUG - Virtual SharePoint User Group weblog</description>
	<lastBuildDate>Thu, 31 Jul 2008 18:18:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Dynamically Updating A SharePoint Calculated Column Containing A &quot;Today&quot; Reference</title>
		<link>http://vspug.com/dez/2008/07/31/dynamically-updating-a-sharepoint-calculated-column-containing-a-quot-today-quot-reference/</link>
		<comments>http://vspug.com/dez/2008/07/31/dynamically-updating-a-sharepoint-calculated-column-containing-a-quot-today-quot-reference/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 18:18:00 +0000</pubDate>
		<dc:creator>Dessie Lunsford</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[When using the (now infamous) &#34;Today&#34; column trick, in calculated columns, you&#39;ll no doubt notice that the dates resulting from this calculation don&#39;t dynamically update.&#160; This has become a major point of contention with the use of this technique in formulas because in most (if not all) cases, the whole point of using this in [...]]]></description>
			<content:encoded><![CDATA[<p>When using the (now infamous) &quot;Today&quot; column trick, in calculated columns, you&#39;ll no doubt notice that the dates resulting from this calculation don&#39;t dynamically update.&nbsp; This has become a major point of contention with the use of this technique in formulas because in most (if not all) cases, the whole point of using this in a formula is to track information that does <b>actually need</b> to be updated (daily, in most cases).</p>
<p>I&#39;ve lost count on the number of discussion threads pointing out this flaw (several of which I&#39;ve participated in myself), so in an attempt to come up with a solution, I&#39;m going to list out a couple options you can take that can (could) be workable to get around this limitation.</p>
<blockquote><p><i>Note &#8211; these are &quot;coded&quot; solutions, but are simple to deploy (modify the following code to meet the needs of your specific environment and best practices).</i></p></blockquote>
<h3>Option 1 &#8211; Console application added as a &quot;Scheduled Task&quot; in Windows</h3>
<p>Performs a &quot;SPListItem.SystemUpdate()&quot; of all items on the target list at 12:01 a.m. each morning (<a href="/forums/t/1352.aspx">as discussed here</a> in a thread I participated in awhile back on the &quot;<a href="/forums">SharePointU</a>&quot; forums). </p>
<p>This program uses &quot;SPListItem.SystemUpdate()&quot; in order to <b>not modify</b> any of the tasks visible details, but since it is an actual update, it will in fact force a re-calculation of any formula using the &quot;Today&quot; reference (the alternative of the &quot;SPListItem.Update()&quot; method will change the &quot;Modified&quot; date property, which in this case we don&#39;t want because it&#39;d be preferable to preserve the date it was last modified by an actual person instead of the system).</p>
<p>Steps to create the application (using the object model &#8211; haven&#39;t tried with web services):</p>
<ol>
<li>In Visual Studio, create a new &quot;Console Application&quot; project (named something like &quot;UpdateSPList&quot;).
</li>
<li>Add in references for &quot;SharePoint&quot; and &quot;System.Configuration&quot; (the latter is optional, but will allow you to use the appropriate &quot;ConfigurationManager&quot; call instead of &quot;ConfigurationSettings&quot;).
</li>
<li>Add in an &quot;Application Configuration File&quot; (will house the name of the site and list &#8211; contained in this configuration file so you can make changes later).
</li>
<li>Add in two &quot;key&#39;s&quot; to hold the name of the site and list:
<p>(Example)<br /><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&lt;?</span><span style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">xml</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"> </span><span style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">version</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">=</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&quot;<span style="COLOR:blue;">1.0</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">encoding</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">utf-8</span>&quot;<span style="COLOR:blue;"> ?&gt;</span></span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&lt;</span><span style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">configuration</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&gt;</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp; </span></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&lt;</span><span style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">appSettings</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&gt;</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&lt;</span><span style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">add</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"> </span><span style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">key</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">=</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&quot;<span style="COLOR:blue;">Site</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">value</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">http://My_Portal/Sites/TheSite</span>&quot;<span style="COLOR:blue;">/&gt;</span></span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&lt;</span><span style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">add</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"> </span><span style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">key</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">=</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&quot;<span style="COLOR:blue;">List</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">value</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">Tasks</span>&quot;<span style="COLOR:blue;">/&gt;</span></span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp; </span></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&lt;/</span><span style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">appSettings</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&gt;</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&lt;/</span><span style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">configuration</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&gt;<br /></span></li>
<li>Change the default &quot;Program.cs&quot; code to be:
<p><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">using</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"> Microsoft.SharePoint;</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">using</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"> System.Configuration;</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">namespace</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"> UpdateSPList</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /></span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">{</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">class</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"> <span style="COLOR:#2b91af;">Program</span></span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">{</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">static</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"> <span style="COLOR:blue;">void</span> Main(<span style="COLOR:blue;">string</span>[] args)</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">{</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;COLOR:#2b91af;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">SPSite</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"> site = <span style="COLOR:blue;">new</span> <span style="COLOR:#2b91af;">SPSite</span>(<span style="COLOR:#2b91af;">ConfigurationManager</span>.AppSettings[<span style="COLOR:#a31515;">&quot;Site&quot;</span>]);</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;COLOR:#2b91af;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">SPWeb</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"> web = site.OpenWeb();</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;COLOR:#2b91af;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">SPList</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"> list = web.Lists[<span style="COLOR:#2b91af;">ConfigurationManager</span>.AppSettings[<span style="COLOR:#a31515;">&quot;List&quot;</span>]];</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">web.AllowUnsafeUpdates = <span style="COLOR:blue;">true</span>;</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">foreach</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"> (<span style="COLOR:#2b91af;">SPListItem</span> item <span style="COLOR:blue;">in</span> list.Items)<br /><span style="">&nbsp;&nbsp; </span><span style="">&nbsp;&nbsp;&nbsp;&nbsp;</span>{</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">item.SystemUpdate();<br /><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">web.AllowUnsafeUpdates = <span style="COLOR:blue;">false</span>;</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">}</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /><span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">}</span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /></span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">}</p>
<p></span></li>
<li><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"></span>Build (compile) the program.
</li>
<li>Copy the &quot;exe&quot; and &quot;config&quot; files from the &quot;debug&quot; folder into the server location that you&#39;ll use for production (&quot;UpdateSPList.exe&quot; and &quot;UpdateSPList.exe.config&quot;).
</li>
<li>Create a new &quot;Scheduled Task&quot; in Windows scheduler that uses &quot;UpdateSPList.exe&quot; and have it scheduled to run after midnight of each day (I use 12:01 a.m., setup as applicable for you).</li>
</ol>
<p>When ran, the application will connect into the site, find the list, open each item on the list and perform an update on it that will force the recalculation of all formulas which will update any dates based off the &quot;Today&quot; reference.</p>
<h3>Option 2 &#8211; Add code to the page in SPD to update the contents each time the page is viewed.</h3>
<blockquote><p><b><i>This approach comes with a warning</i></b><i>, if you choose to enable the ability to run server-side code in your pages, anyone who can upload pages, can access system pages and/or use SPD to connect to and modify pages, will be able to run their own code (<b>use this approach at your own risk</b>).</i></p></blockquote>
<p>To make this approach work, we need to do two things &#8211; modify the &quot;web.config&quot; file to allow us to run code, and then add in the code.</p>
<ol>
<li>Modify the &quot;web.config&quot; file:</li>
<ol>
<li>Using an editor of your choice (notepad, Visual Studio, etc.), open the web configuration file for your site (generally located at &quot;C:InetpubwwwrootwssVirtualDirectories80web.config&quot; if using the &quot;default&quot; site for your instance).</li>
<li>Modify it as follows (you&#39;ll be adding in the &quot;PageParserPath&quot; node):
<p><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&lt;</span><span style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">SafeMode</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"> </span><span style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">MaxControls</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">=</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&quot;<span style="COLOR:blue;">200</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">CallStack</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">false</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">DirectFileDependencies</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">10</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">TotalFileDependencies</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">50</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">AllowPageLevelTrace</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">false</span>&quot;<span style="COLOR:blue;">&gt;</span></span><span style="FONT-SIZE:12pt;FONT-FAMILY:&#39;Times New Roman&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&lt;</span><span style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">PageParserPaths</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&gt;<br />&lt;</span><span style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">PageParserPath</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"> </span><span style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">VirtualPath</span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">=</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;">&quot;<span style="COLOR:blue;">/*</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">CompilationMode</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">Always</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">AllowServerSideScript</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">true</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">IncludeSubFolders</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">true</span>&quot;<span style="COLOR:blue;">/&gt;<br />&lt;/</span><span style="COLOR:#a31515;">PageParserPaths</span><span style="COLOR:blue;">&gt;<br />&lt;/</span><span style="COLOR:#a31515;">SafeMode</span><span style="COLOR:blue;">&gt;<br /></span></span></li>
</ol>
</ol>
<p><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;mso-fareast-font-family:&#39;Times New Roman&#39;;mso-fareast-language:EN-US;mso-ansi-language:EN-US;mso-bidi-language:AR-SA;"><span style="COLOR:blue;"></span></span>This will tell the system the path that contains the pages we want to run code on (&quot;/*&quot; will allow it on all pages), and whether or not to actually allow the code (again &#8211; use with caution).</p>
<p>Once we have enabled the ability to run code, we need to add the code into the page.</p>
<ol start="2">
<li>Using the default &quot;Tasks&quot; list as our example:</li>
<ol>
<li>Open SPD and connect to your site.</li>
<li>Once connected, open the &quot;AllItems.aspx&quot; page for the &quot;Tasks&quot; list (Root of site &gt; Lists &gt; Tasks &gt; AllItems.aspx).</li>
<li>In the &quot;Code&quot; view of the site, locate the section &quot;&lt;SharePoint:RssLink runat=&quot;server&quot;/&gt;&quot; (used as an example &#8211; you could place the code wherever you see fit) and add in the following just below it:
<p style="MARGIN:0in 0in 0pt;mso-list:l0 level2 lfo1;tab-stops:list 1.0in;"><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&lt;</span><span style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:&#39;Courier New&#39;;">script</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"> <span style="COLOR:red;">runat</span><span style="COLOR:blue;">=&quot;server&quot;&gt;</span></span><br /><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">protected</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"> <span style="COLOR:blue;">void</span> Page_Load(<span style="COLOR:blue;">object</span> sender, <span style="COLOR:#2b91af;">EventArgs</span> e)</span></p>
<p><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;">{</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"><span style="mso-tab-count:1;">&nbsp;&nbsp; </span>SPSite site = <span style="COLOR:blue;">new</span> SPSite(<span style="COLOR:#a31515;">&quot;&lt;Your_Site_URL&gt;&quot;</span>);</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"><span style="mso-tab-count:1;">&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; </span>SPWeb web = site.OpenWeb();</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"><span style="mso-tab-count:1;">&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; </span>SPList list = web.Lists[<span style="COLOR:#a31515;">&quot;Tasks&quot;</span>];</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"><span style="mso-tab-count:1;">&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; </span>web.AllowUnsafeUpdates = <span style="COLOR:blue;">true</span>;</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"><span style="mso-tab-count:1;">&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; </span><span style="COLOR:blue;">foreach</span> (SPListItem item <span style="COLOR:blue;">in</span> list.Items)</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"><span style="mso-tab-count:1;">&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; </span>{</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count:1;">&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>item.SystemUpdate();</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"><span style="">&nbsp;</span><span style="mso-tab-count:1;">&nbsp; <br />&nbsp;&nbsp;&nbsp; </span>}<br />&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;">web.AllowUnsafeUpdates = <span style="COLOR:blue;">false</span>;</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"><span style="">&nbsp;<br /></span>}</span> </p>
<p style="MARGIN:0in 0in 0pt;"><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"><span style="COLOR:blue;">&lt;/</span><span style="COLOR:#a31515;">script</span><span style="COLOR:blue;">&gt;<br /></span></span></p>
</li>
</ol>
</ol>
<p>(Notice it&#39;s the exact same code as used in the &quot;Console Application&quot; except for the site and list are specified in the code rather than in a configuration file for this example)</p>
<ol start="3">
<li>Save the page (ignoring any errors or &quot;squiggly&quot; lines you may see in the code view).</li>
</ol>
<p>Since we&#39;ve told the system to allow us to run code in the page (via the &quot;web.config&quot; file), once we now visit the page, all items on the list should be updated without throwing any errors (the update of items will occur each time the page is visited).</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Both of these solutions will work, but depending on your environment may, or may not, be doable (especially if you don&#39;t have access to the server running SharePoint or access via SPD &#8211; I generally don&#39;t develop for web services since I do have the access I need, but you may be able to work up a similar application that accesses SharePoint via its web services as another option).&nbsp; </p>
<blockquote><p><i>Additionally, the above code should be used as a reference for how to create the &quot;Update&quot; functionality and can (should) be written in a better fashion (disposing objects etc.) to follow good programming practices&#8230;this is just an example &#8211; modify it as you see fit.</i></p></blockquote>
<p>Aside from these two methods, you may also be able to use a workflow to update the list that fires off each time an item is updated.&nbsp; Although this approach does work as well, I don&#39;t like the idea of creating an endless loop and I believe there&#39;s also an issue with how many times a self-fired SPD workflow will run (it appears to stop working after a time).&nbsp; </p>
<p>There may be other methods as well to get the calculated column&#39;s formula to dynamically update each day, but both of the methods I&#39;ve listed above seem to do the trick with minimal effort (and are easy to disable/update when needed).</p>
<p>I&#39;m still looking for other approaches to tackle this, especially since I&#39;ve been blogging recently on Mark Miller&#39;s site (<a href="http://www.endusersharepoint.com/?cat=397">EndUserSharePoint.com</a>) regarding calculated columns (with a bunch of examples using the &quot;Today&quot; column trick).&nbsp; So if anyone has any other suggestions/approaches (not just coded, any other ideas that might work better for end-users, not just programmers) <b>please share them</b>.</p>
<p>Hopefully these ideas will help, they&#39;re not perfect (perfect would be the system doing what we want without these types of hacks), but at least as a work-around they&#39;ll do the job.</p>
<p>Till next time&#8230;</p>
<p>- Dink </p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/dez/2008/07/31/dynamically-updating-a-sharepoint-calculated-column-containing-a-quot-today-quot-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Employee Training and Scheduling Template &#8211; a couple fixes Part 3</title>
		<link>http://vspug.com/dez/2008/07/24/employee-training-and-scheduling-template-a-couple-fixes-part-3/</link>
		<comments>http://vspug.com/dez/2008/07/24/employee-training-and-scheduling-template-a-couple-fixes-part-3/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 23:04:00 +0000</pubDate>
		<dc:creator>Dessie Lunsford</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[Took me long enough to get this post up, but it&#39;s finally done (hopefully &#8211; please let me know if you come across any errors in the walkthrough). 
Refer to the previous two articles in this series for additional customizations necessary to make this template function correctly. Employee Training and Scheduling Template &#8211; a couple [...]]]></description>
			<content:encoded><![CDATA[<p>Took me long enough to get this post up, but it&#39;s finally done (hopefully &#8211; please let me know if you come across any errors in the walkthrough). </p>
<p><i>Refer to the previous two articles in this series for additional customizations necessary to make this template function correctly. <br /><a href="/dez/archive/2007/09/19/employee-training-and-scheduling-template-a-couple-fixes.aspx">Employee Training and Scheduling Template &#8211; a couple fixes Part 1 </a><br /><a href="/dez/archive/2007/09/19/employee-training-and-scheduling-template-a-couple-fixes-part-2.aspx">Employee Training and Scheduling Template &#8211; a couple fixes Part 2 </a></i></p>
<p>In this walkthrough, we&#39;ll be covering how to set permissions and make additional customizations to the &quot;Employee Training Scheduling and Materials&quot; template that allows users to register (and unregister) for courses without the (perceived) ability of being able to create their own &quot;Courses&quot; or &quot;muck-up&quot; anything else in site that we wouldn&#39;t want them to.</p>
<p>One of the major problems with how this template was designed is that in order to make it so a user can register and unregister from a course, they must have what&#39;s roughly equal to &quot;Contribute&quot; permissions on each of the lists associated with the &quot;Course&quot;.&nbsp; This, of course, opens up the possibility of users being able to do more than they should, and could lead to the entire process breaking down at some point if an errant user were to add in their own Courses on the calendar, or remove existing ones (not that anyone at your company <b>would ever</b> do such a thing).</p>
<p>So, to get the environment setup better to limit what a user can do (or more realistically, the &quot;perception&quot; of what they can do), the steps are as follows:</p>
<h3>Step 1: Create the site:</h3>
<p>Once created, break inheritance on the site.&nbsp; It&#39;s important to begin with a unique site that doesn&#39;t have any fall-through from permissions at its parent (we&#39;re creating a new &quot;custom&quot; permission level to use for the users of this site).</p>
<h3>Step 2: Modify site to make it custom (part I):</h3>
<ol>
<li>Go into the permissions area of the site and break inheritance on the permission levels (the &quot;definition&quot; of these levels will now exist locally instead of being defined at the parent).&nbsp; </li>
<li>Once broken, remove any and all permissions except for defaults (&quot;Full Control&quot;, &quot;Design&quot;, &quot;Contribute&quot;, &quot;Read&quot;, &quot;Limited&quot; &#8211; this resets the permissions-available back to an &quot;Out of the box&quot; list if you had other custom definitions). </li>
<li>Create a new custom permission level by starting with the definition of the default &quot;Contribute&quot; level.
<ol>
<li>To do this, click on &quot;Contribute&quot; to edit, scroll to the bottom of the permissions page after it opens and click &quot;Copy Permission Level&quot; (this creates a new unnamed level that has all the options the &quot;Contribute&quot; level has as a starting point). </li>
<li>Name the new level &quot;Employee Regs&quot; (or similar that fits your environment), add in a simple description to remind you that this level is for employee registrants, then modify the list of permissions to be set as follows:
<ol>
<li>List Permissions
<ol>
<li>Add Items</li>
<li>Edit Items</li>
<li>Delete Items</li>
<li>View Items</li>
<li>Open Items</li>
</ol>
</li>
<li>Site Permissions
<ol>
<li>Browse Directories</li>
<li>View Pages</li>
<li>Open</li>
</ol>
</li>
<li>Personal Permissions
<ol>
<li>Uncheck all</li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
</ol>
<p>These are the minimum permissions needed in order for users to be able to register for a course and unregister if needed.&nbsp; The problem again, is that with these permissions, a user could in theory, create a new &quot;Course&quot;, delete an existing &quot;Course&quot;, delete another user who is registered for a course, or modify anything existing.&nbsp; None of this is really acceptable, so what we need to do is now go through the site and first limit their access to areas not associated with the workflows for registration, then limit the manner in which they can gain direct access to areas they <b>do</b> have permission to. </p>
<p>First though, let&#39;s finish up the permissions part by creating a new group that this custom level will be applied to.</p>
<ol start="4">
<li>Go to &quot;People and Groups&quot; and create a new group and name it in a manner that fits in with your naming convention for the rest of the site, but for good practice make sure to name it in a manner that makes it indicative of being for &quot;Registrants&quot; (e.g. your site is named &quot;ACME Training&quot; &#8211; an appropriate name for this group might be &quot;ACME Employee Registrants&quot; or similar).&nbsp; </li>
<li>Once created, set this new group&#39;s permission level to the new custom permission level we previously created (in my case, &quot;Employee Regs&quot;).</li>
</ol>
<p>At this point since the group has been created, you can add in your users that will be registering (or wait until all the customizations are completed &#8211; <b>either way, don&#39;t forget to add in your users</b>).</p>
<p>Now we need to start limiting what our users can see (the idea is that &quot;<b>If we hide it, they won&#39;t find it!!</b>&quot;).</p>
<h3>Modify site through SharePoint Designer (Part I)</h3>
<ol>
<li>In SharePoint Designer, connect to your site. </li>
<li>If you haven&#39;t done this already, modify the site as per (<a href="/dez/archive/2007/09/19/employee-training-and-scheduling-template-a-couple-fixes-part-2.aspx">&#8230;a couple fixes Part 2</a>) </li>
<li>Modify web parts visibility
<ol>
<li>Open default.master </li>
<li>In &quot;Design&quot; view, locate &quot;View All Site Content&quot; on the left-hand-site navigation bar and click on it. </li>
<li>Go to &quot;Code&quot; view. You will see the following code highlighted: <br />&lt;Sharepoint:SPSecurityTrimmedControl runat=&quot;server&quot; PermissionsString=&quot;ViewFormPages&quot;&gt;&lt;div class=&quot;ms-quicklaunchheader&quot;&gt;&lt;SharePoint:SPLinkButton id=&quot;idNavLinkViewAll&quot; runat=&quot;server&quot; NavigateUrl=&quot;~site/_layouts/viewlsts.aspx&quot; Text=&quot;&lt;%$Resources:wss,quiklnch_allcontent%&gt;&quot; AccessKey=&quot;&lt;%$Resources:wss,quiklnch_allcontent_AK%&gt;&quot;/&gt;&lt;/div&gt;&lt;/SharePoint:SPSecurityTrimmedControl&gt; </li>
<li>Change the &quot;PermissionString&quot; attribute value of the &quot;Sharepoint:SPSecurityTrimmedControl&quot; element from &quot;ViewFormPages&quot; to &quot;DeleteVersions&quot;. </li>
<li>Save the default.master. </li>
</ol>
</li>
</ol>
<p><i>If you login as a member of the &quot;ACME Employee Registrants&quot; group, you will not see the &quot;View All Site Content&quot; link (this is important because it will not let unauthorized users see the listing of site &quot;lists&quot;). However, when authenticated as a member of the site owners or contributors group, you will see this option.</i></p>
<p><i>NOTE: The &quot;DeleteVersions&quot; permission is common to both the &quot;Members&quot; and &quot;Owners&quot; group permission levels, but is not set for the &quot;Limited Access&quot; (anonymous users), &quot;Read&quot;, or &quot;Employee Regs&quot; permission levels.</i> </p>
<ol start="4">
<li>Modify dispform.aspx to hide &quot;Course Registration List&quot; (lists/courses/dispform.aspx)
<ol>
<li>Add in new &quot;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&quot; tags after &quot;Main&quot; web part zone table row closes, and add in: &lt;Sharepoint:SPSecurityTrimmedControl PermissionsString=&quot;DeleteVersions&quot; runat=&quot;server&quot;&gt;&lt;WebPartPages:WebPartZone runat=&quot;server&quot; FrameType=&quot;None&quot; ID=&quot;Bottom&quot; Title=&quot;loc:Bottom&quot;&gt;&lt;ZoneTemplate&gt;&lt;/ZoneTemplate&gt;&lt;/WebPartPages:WebPartZone&gt;&lt;/Sharepoint:SPSecurityTrimmedControl&gt;<br />(this adds a second zone under top one) </li>
<li>Save and close file (ignoring any errors displayed in the designer). </li>
</ol>
</li>
</ol>
<h3>Step 4: Modify site to make it custom (part II):</h3>
<ol>
<li>In the browser, go to the site homepage</li>
<li>In edit mode (Site Actions &gt; Edit Page) remove each of the following webparts:
<ol>
<li>Courses I have taught</li>
<li>Courses I am teaching</li>
<li>Courses I have attended</li>
<li>Content Editor Web Part</li>
<li>Links</li>
</ol>
</li>
<li>On left zone add Courses web part (and drag to bottom of zone)</li>
<li>Click &quot;View all site content
<ol>
<li>Go to &quot;Course Materials&quot;
<ol>
<li>Edit permissions
<ol>
<li>Change permissions of &quot;ACME Employee Registrants&quot; group to &quot;read&quot;</li>
</ol>
</li>
</ol>
</li>
<li>Go to &quot;Announcements&quot;
<ol>
<li>Delete &quot;Announcements&quot; list (<b>the guy that built this template for Microsoft left some errant information in the list which will cause some errors if you use it so we need to recreate it</b>)</li>
<li>Go to the &quot;Create&quot; screen and select &quot;Announcements&quot;
<ol>
<li>name it &quot;Announcements&quot;</li>
<li>leave rest as default and click create</li>
</ol>
</li>
<li>Go back into the settings for the &quot;Announcements&quot; list and edit Permissions
<ol>
<li>Change permissions of &quot;ACME Employee Registrants&quot; group to &quot;read&quot;</li>
</ol>
</li>
</ol>
</li>
<li>Delete &quot;Course Surveys&quot;</li>
<li>Courses
<ol>
<li>Leave Permissions as is</li>
<li>Modify webpart toolbar to &quot;Summary Toolbar&quot;</li>
</ol>
</li>
<li>Links
<ol>
<li>Edit Permissions
<ol>
<li>Change permissions of &quot;ACME Employee Registrants&quot; group to &quot;read&quot;</li>
</ol>
</li>
</ol>
</li>
<li>Past Registrations
<ol>
<li>Leave permissions as is</li>
</ol>
</li>
<li>Registrations
<ol>
<li>Leave permissions as is</li>
<li>Modify webpart toolbar to &quot;No toolbar&quot;</li>
</ol>
</li>
<li>Tasks
<ol>
<li>Leave all as is</li>
</ol>
</li>
</ol>
</li>
<li>Quick launch
<ol>
<li>Delete Add new course</li>
<li>Delete upload materials</li>
<li>Delete Course Surveys (this will also delete &quot;add new feedback&quot;)</li>
<li>Delete Announcements (will add back later)</li>
</ol>
</li>
<li>Go back to home page</li>
<li>Quick launch
<ol>
<li>Go to announcements list
<ol>
<li>Edit Permissions
<ol>
<li>Change permissions of &quot;ACME Employee Registrants&quot; group to &quot;read&quot;</li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
<li>Go back to home page
<ol>
<li>In edit mode, add the Announcements webpart to the right zone.</li>
<li>Change view of &quot;Courses&quot; webpart to &quot;calendar&quot;</li>
<li>Exit edit mode</li>
</ol>
</li>
<li>Quick Launch
<ol>
<li>Copy URL from &quot;Announcements&quot; listing under list heading</li>
<li>Replace URL on lists with Announcements URL</li>
<li>Rename lists to &quot;Announcements&quot;</li>
<li>Delete announcements sub-heading (list item under main heading)</li>
</ol>
</li>
<li>Modify &quot;Courses I am attending&quot; webpart XSL to function correctly when un-registering (<b>see Previous post</b>)
<ol>
<li>On home page, go into edit mode and open the &quot;XSL Editor&quot; for the webpart
<ol>
<li>Find:<br />&quot;You are not scheduled to attend any courses.&quot;<br />and:<br />&quot;Choose &amp;quot;Upcoming courses&amp;quot; from the Quick Launch bar to select an available course to register for.&quot;</li>
<li>Replace with:<br />&quot;You are not scheduled to attend any Sessions.&quot;<br />and:<br />&quot;Choose &amp;quot;Upcoming Sessions&amp;quot; from the Quick Launch bar to select an available Session to register for.&quot;</li>
<li>Find:<br />&lt;td class=&quot;ms-vb&quot;&gt;&lt;a href=&quot;Lists/Registrations/Unregister.aspx?ID={../../../Registrations/Rows/Row/@ID}&quot; mce_href=&quot;Lists/Registrations/Unregister.aspx?ID={../../../Registrations/Rows/Row/@ID}&quot;&gt;Remove&lt;/a&gt;&lt;/td&gt;</li>
<li>Replace with:<br />&lt;td class=&quot;ms-vb&quot;&gt;&lt;xsl:variable name=&quot;CourseID&quot; select=&quot;@ID&quot;/&gt;&lt;a href=&quot;Lists/Registrations/Unregister.aspx?ID={../../../Registrations/Rows/Row[@Course_x0020_ID=$CourseID and contains(@Author, $UserID)]/@ID}&quot;&gt;Remove&lt;/a&gt;&lt;/td</li>
</ol>
</li>
</ol>
</li>
</ol>
<h3>Step 5: Modify site through SP Designer (Part II)</h3>
<ol>
<li>Modify default.aspx
<ol>
<li>Open default.aspx in SP Designer (at root of site)</li>
<li>Click to select the &quot;Left&quot; webpart zone.</li>
<li>Scroll to the bottom of the webpart zone in the html view</li>
<li>Immediately after &quot;&lt;/ZoneTemplate&gt;&lt;/WebPartPages:WebPartZone&gt;&quot;<br />add in:<br />&lt;Sharepoint:SPSecurityTrimmedControl PermissionsString=&quot;DeleteVersions&quot; runat=&quot;server&quot;&gt;&lt;WebPartPages:WebPartZone runat=&quot;server&quot; FrameType=&quot;TitleBarOnly&quot; ID=&quot;Bottom&quot; Title=&quot;loc:Bottom&quot;&gt;&lt;ZoneTemplate&gt;&lt;/ZoneTemplate&gt;&lt;/WebPartPages:WebPartZone&gt;&lt;/Sharepoint:SPSecurityTrimmedControl&gt;</li>
<li>Save page</li>
</ol>
</li>
</ol>
<h3>Step 6: Modify site to make custom (Part III)</h3>
<ol>
<li>In the site (on any event details page), go into &quot;edit page&quot; mode and drag the &quot;Course Registration List&quot; web part to the new bottom zone from the top zone.<br />When a user visits the page, the list of currently signed up users will now only display to the members of the site owners and contributors groups (registered employees will not be able to see the list).<br /><font color="red"><br /><strong>(8/7/08) EDIT &#8211; ADDED STEP I FORGOT ABOUT IN ORIGINAL POST</strong></font> <em>(Thanks to Sara for pointing this out in a comment)</em>
<ol>
<li>While in &quot;Edit&quot; mode, open the toolpane for the &quot;Courses&quot; list (edit &gt; Modify Shared Web Part).
<ol>
<li>Open the &quot;XSL&quot; editor and locate the following:<br />&lt;SharePoint:FormToolBar runat=&quot;server&quot; ControlMode=&quot;Display&quot;/&gt;<br />Comment out this line to remove the toolbar from display<br />(add in &lt;!&#8211; &#8211;&gt; around the tag to hide it)<br /><strong>This is neccessary in order to prevent users from being able to create/edit/delete/etc., the items on the &quot;Courses&quot; list.</strong> </li>
</ol>
</li>
</ol>
</li>
<li>Back on Home Page
<ol>
<li>Add a content editor webpart to the new &quot;bottom&quot; zone
<ol>
<li>Add in the following html:<br />&lt;A href=&quot;/&lt;the new site URL&gt;/Lists/Courses/AllItems.aspx&quot;&gt;Click here to add new Calendar Events&lt;/A&gt;</li>
<li>This will give access to the screen where admins of the site can enter in new calendar events.</li>
</ol>
</li>
</ol>
</li>
</ol>
<h3>Conclusion:</h3>
<p>Using the above, you can definitely see that it can take quite a bit to customize this template to make it a &quot;workable&quot; platform for managing training sessions and user registrations.</p>
<p>To give you an example of what my organization has gotten out of this template:</p>
<p>We have a number of &quot;Assessment Sessions&quot; scheduled each week that we use for placement into various classes (part of a &quot;Student&quot; entry system to make sure they can succeed in the classes they sign up for later).&nbsp; The problem we had in the past is that in order to register for one of the sessions, a user had to submit the request by email, phone, or physically come to the campus and fill out a paper registration form (add their name to the list for the day).&nbsp; This worked, but human-nature reared its ugly head numerous times causing emails to get overlooked, phone messages not collected correctly, and registration forms to simply go missing.</p>
<p>Enter the &quot;ETSM&quot; template.</p>
<p>After playing around with the template and working up the above steps to customize it, we were finally able to get a system up and running that could not only give users the ability to register themselves, but from a single place (online).</p>
<p>There&#39;s still obviously some extra functionality that needs to be added in to make things work better (ability for an administrator to register someone else, for one), but over time I think the community that has taken a shine to this template will definitely figure out ways to accommodate these &quot;wish-list&quot; items and make the template &quot;fully-functional&quot;.</p>
<p>Till next time&#8230;</p>
<p>- Dink</p>
<p><i>For more information on this template, how is was created [and by who], and a general view at why it does what it does, check out the series of posts by the &quot;Microsoft SharePoint Designer&quot; team on the MSDN blog site:</i></p>
<p><a href="http://blogs.msdn.com/sharepointdesigner/archive/2007/03/10/training-site-template-part-1-introduction.aspx">http://blogs.msdn.com/sharepointdesigner/archive/2007/03/10/training-site-template-part-1-introduction.aspx</a><br /><a href="http://blogs.msdn.com/sharepointdesigner/archive/2007/03/23/training-site-template-part-2-workflows.aspx">http://blogs.msdn.com/sharepointdesigner/archive/2007/03/23/training-site-template-part-2-workflows.aspx</a><br /><a href="http://blogs.msdn.com/sharepointdesigner/archive/2008/07/04/training-site-template-part-3-custom-views-and-forms.aspx">http://blogs.msdn.com/sharepointdesigner/archive/2008/07/04/training-site-template-part-3-custom-views-and-forms.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/dez/2008/07/24/employee-training-and-scheduling-template-a-couple-fixes-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How can I save a custom view and reuse it in another document library?</title>
		<link>http://vspug.com/dez/2008/02/12/how-can-i-save-a-custom-view-and-reuse-it-in-another-document-library/</link>
		<comments>http://vspug.com/dez/2008/02/12/how-can-i-save-a-custom-view-and-reuse-it-in-another-document-library/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 20:32:00 +0000</pubDate>
		<dc:creator>Dessie Lunsford</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[I saw the question come up over on Mark Miller&#39;s site about how to save a custom View for use in another document library, so I decided to play around with it some to see what I could come up with for a solution to this.
Basically, what I&#39;ve found is that there appears to be [...]]]></description>
			<content:encoded><![CDATA[<p>I saw the question come up over on <a href="http://www.endusersharepoint.com/?p=128" target="_blank">Mark Miller&#39;s</a> site about how to save a custom View for use in another document library, so I decided to play around with it some to see what I could come up with for a solution to this.</p>
<p>Basically, what I&#39;ve found is that there appears to be two ways to approach this:</p>
<p>First, you can do the &#8220;Save library as a template&#8221; option which will copy over any custom views you have&#8230;which sounds simple enough for creating any new libraries, but what about if you have an existing library?&nbsp; How do we get the view transferred over?</p>
<p>To do this we&#39;ll have to use the second option of using SharePoint Designer to add in a new &#8220;view page&#8221; to an existing site&#39;s document library.</p>
<p><em>For this example, I&#39;ll be using two sites.&nbsp; The first site (where I&#39;ll be creating the &#8220;master&#8221; view) is called &#8220;Test site 1&#8243; (URL is &quot;</em><em><strong>http://portal/ts1</strong></em><em>&#8220;) which has the default document library &#8220;Shared Documents&#8221;.&nbsp; The second site will be called &#8220;Test site 2&#8243; (URL is &quot;</em><em><strong>http://portal/ts2</strong>&quot;</em><em>) and also has a default document library called &#8220;Shared Documents&#8221;.<br />The view I&#39;ll be creating is called &#8220;MyView&#8221; (and &#8220;MyNewView&#8221;) and will display the following columns:</em></p>
<ul>
<li><em>&#8220;Name (linked to document with edit menu)&#8221;</em></li>
<li><em>&#8220;Created&#8221;</em></li>
<li><em>&#8220;Version&#8221;</em></li>
</ul>
<p><em>This is a simple test, but will illustrate how to apply the custom view to another library.</em></p>
<p>First, in the &#8220;master&#8221; document library (&#8220;Shared Documents&#8221; in the &#8220;Test site 1&#8243; site), create the view using the columns listed above and name it &#8220;Test&#8221;.&nbsp; Once you have the view created, open the site (&#8220;Test site 1&#8243;) in SPD (SharePoint Designer), and navigate to the &#8220;Shared Documents &gt; Forms&#8221; folder, and open the &#8220;Test.aspx&#8221; file (the view we just created).</p>
<p>Next, open another instance of SPD and open &#8220;Test site 2&#8243;.&nbsp; Once it&#39;s open, navigate to the &#8220;Shared Documents &gt; Forms&#8221; folder.&nbsp; Once there, &#8220;right-click&#8221; on the &#8220;Forms&#8221; folder and choose &#8220;New &gt; ASPX&#8221; to create a new &#8220;view&#8221; file (name it &#8220;MyView&#8221; for this test), then &#8220;double-click&#8221; the &#8220;MyView.aspx&#8221; file to open it.</p>
<p><em><strong>Now comes the fun part!!</strong></em></p>
<p>Switch back to the &#8220;Test.aspx&#8221; file and copy its entire html (in the html view, &#8220;right-click&#8221; and select all &#8211; &#8220;ctrl+a&#8221; &#8211; whichever method you like), then switch back to the &#8220;MyView.aspx&#8221; file and replace its entire html with what you just copied (basically, replace the entire html for the &#8220;MyView.aspx&#8221; file with the html from the &#8220;Test.aspx&#8221; file).</p>
<p>Next, we need to change the &#8220;<strong>guid</strong>&#8221; that is being referenced in the &#8220;old&#8221; html (ID pointer to the document library) to that of the new document library.&nbsp; The easiest way to do this is to open the site in a browser, go to the document library, then go to &#8220;Settings &gt; Document Library Settings&#8221;.&nbsp; In the address bar, the URL will have the guid as the last part of the address.</p>
<p>Example:<br /><strong>http://Portal/Test1/_layouts/listedit.aspx?List=%7B35A23714%2D25E3%2D42A5%2DB4BA%2D868F31906FA2%7D</strong></p>
<p>Guid would be the last part of the URL:<br />%7B35A23714%2D25E3%2D42A5%2DB4BA%2D868F31906FA2%7D</p>
<p>Modify the guid to be in the following format:<br />{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}</p>
<p>This means replacing the html equivalents to the real characters as such:<br />{35A23714-25E3-42A5-B4BA-868F31906FA2}</p>
<ul>
<li>%7B becomes {</li>
<li>%2D becomes -,</li>
<li>%7D becomes }</li>
</ul>
<p>Do this for both document libraries then switch back to the &#8220;MyView.aspx&#8221; file and perform a simple &#8220;find-and-replace&#8221; on the old guid (replace the guid associated with the document library from the &#8220;Test site 1&#8243; library to the guid for the document library in the &#8220;Test site 2&#8243; site).&nbsp; There should only be one replace (approximately on line #53).&nbsp; Also, (two lines down from the guid &#8211; should be approx. line#55) you need to update the &#8220;Url&#8221; attribute to be the correct site (&#8220;ts2&#8243; instead of &#8220;ts1&#8243; &#8211; you can also use the &#8220;find-and-replace&#8221; method to change this), and on the same line change the &#8220;Display Name&#8221; attribute to be what you want displayed in the dropdown for the name of the view (optional &#8211; you can leave as is if you want).</p>
<p>Once you&#39;ve made the changes, save the file.&nbsp; You&#39;ll see a popup informing you that &#8220;The URL `Shared Documents/Forms/MyView.aspx&#39; is invalid.&nbsp; It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web&#8221;.&nbsp; I believe this is because there may still be a reference to the old library (or site) somewhere in the page (which I wasn&#39;t able to find), but the easy workaround is to just save the page with a different name (for this I chose &#8220;MyNewView&#8221;).&nbsp; Once it is saved as the new name, you can delete the &#8220;MyView.aspx&#8221; page since we won&#39;t be using it.</p>
<p>Once you have the above completed, switch back to the &#8220;Test site 2&#8243; site and go to the document library.&nbsp; Refresh the page and look at the available views (you&#39;ll notice a new&nbsp;listing&nbsp;with the name you gave it during the &quot;find-and-replace&quot; part, which&nbsp;is now available).</p>
<p>From here you can simply apply the view and use it as normal.</p>
<p>So far, I&#39;ve ran through this about 6 or so times and haven&#39;t found any immediate problems, but with anything custom you do to modify the site (especially through SPD) there may be something that does come up, so if you run into any problems, post a comment here and we&#39;ll look and see if we can find out what&#39;s happening.</p>
<p>- Dink</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/dez/2008/02/12/how-can-i-save-a-custom-view-and-reuse-it-in-another-document-library/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Copying documents between libraries with metadata &#8211; including version history</title>
		<link>http://vspug.com/dez/2007/11/30/moving-copying-documents-between-libraries-with-metadata-including-version-history/</link>
		<comments>http://vspug.com/dez/2007/11/30/moving-copying-documents-between-libraries-with-metadata-including-version-history/#comments</comments>
		<pubDate>Fri, 30 Nov 2007 14:50:00 +0000</pubDate>
		<dc:creator>Dessie Lunsford</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[
&#8211; &#8220;How do you move (or copy) documents from one library to another while keeping version history intact?&#8221; &#8211;
This is one of those tasks that, although it sounds pretty straightforward and simple is actually not one of the easiest things to take care of.
From what I&#39;ve been able to find, there&#39;s really only a few [...]]]></description>
			<content:encoded><![CDATA[<p><i style="mso-bidi-font-style:normal;"><span style="FONT-SIZE:18pt;"><font face="Times New Roman"><br />
&#8211; &#8220;How do you move (or copy) documents from one library to another while keeping version history intact?&#8221; &#8211;</font></span></i></p>
<p><font face="Times New Roman">This is one of those tasks that, although it sounds pretty straightforward and simple is actually not one of the easiest things to take care of.</p>
<p>From what I&#39;ve been able to find, there&#39;s really only a few different approaches to this that most folks take:</font></p>
<ul>
<li><font face="Times New Roman">Explorer view (or Network place)&nbsp;copy/paste</font></li>
<li><font face="Times New Roman">Save site as a template &#8211; including content (*only works if library size is less than 10MB)</font></li>
<li><font face="Times New Roman">Or the new &quot;Manage Content Structure&quot; page offered in MOSS.</font></li>
</ul>
<p><font face="Times New Roman">The first option, as proved numerous times by many users, does indeed copy the file(s) to the new library, but it doesn&#39;t preserve any version history (note &#8211; apparently for some users,&nbsp;doing a &quot;<b style="mso-bidi-font-weight:normal;">move</b>&quot; rather than a &quot;<b style="mso-bidi-font-weight:normal;">copy</b>&quot; has successfully brought over the version history, although I have never gotten his to work and realistically, I don&#39;t prefer this approach because I don&#39;t care for the idea of losing the original source document in this scenario).</font></p>
<p><font face="Times New Roman">Option two is also not a reliable approach due to the size limit&#39;s on how big the content can be that you&#39;re saving (*<b style="mso-bidi-font-weight:normal;">default limit only &#8211; size can be modified through STSADM &#8211; </b>mentioned here: </font><a href="http://blogs.microsoft.co.il/blogs/meronf/archive/2006/08/22/2617.aspx"><font face="Times New Roman">http://blogs.microsoft.co.il/blogs/meronf/archive/2006/08/22/2617.aspx</font></a><font face="Times New Roman">), and it&#39;s kind of a &#8220;kludgy&#8221; approach in the first place because its really just a work-around to move documents <b style="mso-bidi-font-weight:normal;"><u>one time</u></b> (not a true &#8220;archiving&#8221; method since you cant just make updates based on the original documents and apply those changes to the &#8220;templated&#8221; library &#8211; obviously this isn&#39;t the point of this method, but some users may want this functionality and wont have it if following this approach).</font></p>
<p><font face="Times New Roman">Option three relies on your having MOSS installed.&nbsp; <br />Ok, fine&#8230;<b style="mso-bidi-font-weight:normal;">but what about those of us working with an instance of WSS only and not MOSS?</b></p>
<p>After researching all the possible approaches (minus paying someone an outrageous amount of money for a program that promised to do this), I decided to investigate if I can perform this programmatically through the SharePoint object model&#8230;which I&#39;m happy to report was not quite as difficult as I had thought (although I ran into a few interesting logic problems along the way, but did manage to get past them).<br /></font></p>
<p><font face="Times New Roman">&nbsp;</font><i style="mso-bidi-font-style:normal;"><span style="FONT-SIZE:18pt;"><font face="Times New Roman"><br />
&#8211; Version history?<span style="">&nbsp; </span>What the Heck??? &#8211;</font></span></i></p>
<p><font face="Times New Roman">The first thing we need to understand is just how SharePoint deals with versions.<span style="">&nbsp; </span>Once you turn on versioning on a document library, you&#39;re enabling the use of a new &#8220;<b style="mso-bidi-font-weight:normal;">virtual</b>&#8221; directory set aside for the sole purpose of providing a &#8220;web&#8221; interface to access previous versions of a document that are all stored in the content database.<span style="">&nbsp; </span>This new directory is called &#8220;<b style="mso-bidi-font-weight:normal;">_vti_history</b>&#8220;, and includes a number in each document&#39;s URL that signifies it&#39;s actual version &#8211; it&#39;s also important to note that <b style="mso-bidi-font-weight:normal;">all the documents accessed in the virtual folder are previous versions of the document only</b>, not the current version that is displayed in the document library itself (this will be important to remember later when programming on versions).</font></p>
<p><font face="Times New Roman">An example of these URL&#39;s for document versions would be something similar to:</font></p>
<ul>
<li><font face="Times New Roman">http://www.mydomain.com/_vti_history/1/Shared%20Documents/Test.doc</font></li>
<li><font face="Times New Roman">http://www.mydomain.com/_vti_history/2/Shared%20Documents/Test.doc</font></li>
<li><font face="Times New Roman">http://www.mydomain.com/_vti_history/3/Shared%20Documents/Test.doc</font></li>
<li><font face="Times New Roman">http://www.mydomain.com/_vti_history/512/Shared%20Documents/Test.doc</font></li>
<li><font face="Times New Roman">http://www.mydomain.com/_vti_history/1024/Shared%20Documents/Test.doc</font></li>
<li><font face="Times New Roman">http://www.mydomain.com/_vti_history/1025/Shared%20Documents/Test.doc</font></li>
<li><font face="Times New Roman">http://www.mydomain.com/Shared%20Documents/Test.doc</font></li>
</ul>
<p><font face="Times New Roman">(The last URL listed does not contain a number or the &#8220;_vti_history&#8221; path because it is the <b style="mso-bidi-font-weight:normal;">current version</b> of the document.)</font></p>
<p><font face="Times New Roman">You&#39;ll notice in the URL&#39;s the number immediately following the &#8220;_vti_history/&#8221; part of the address.<span style="">&nbsp; </span>This number specifies exactly what the version number is for the document.</font></p>
<ul>
<li><font face="Times New Roman">URL number &#8220;<b style="mso-bidi-font-weight:normal;">1</b>&#8221; = version &#8220;<b style="mso-bidi-font-weight:normal;">0.1</b>&#8220;</font></li>
<li><font face="Times New Roman">URL number &#8220;<b style="mso-bidi-font-weight:normal;">2</b>&#8221; = version &#8220;<b style="mso-bidi-font-weight:normal;">0.2</b>&#8220;</font></li>
<li><font face="Times New Roman">URL number &#8220;<b style="mso-bidi-font-weight:normal;">3</b>&#8221; = version &#8220;<b style="mso-bidi-font-weight:normal;">0.3</b>&#8220;</font></li>
<li><font face="Times New Roman">URL number &#8220;<b style="mso-bidi-font-weight:normal;">512</b>&#8221; = version &#8220;<b style="mso-bidi-font-weight:normal;">1.0</b>&#8220;</font></li>
<li><font face="Times New Roman">URL number &#8220;<b style="mso-bidi-font-weight:normal;">1024</b>&#8221; = version &#8220;<b style="mso-bidi-font-weight:normal;">2.0</b>&#8220;</font></li>
<li><font face="Times New Roman">URL number &#8220;<b style="mso-bidi-font-weight:normal;">1025</b>&#8221; = version &#8220;<b style="mso-bidi-font-weight:normal;">2.1</b>&#8220;</font></li>
</ul>
<p><font><font face="Times New Roman">So, by looking at these numbers, we can start to see a pattern forming (which again will become very important later when we begin coding).<span style="">&nbsp; </span>You&#39;ll notice that all the minor versions (numbers to the right of the decimal point) are all based on a single number counting system, whereas the major versions (numbers on the left of the decimal point) are based on a &#8220;512&#8243; increment system (I like to call this a &#8220;<b style="mso-bidi-font-weight:normal;">base-512</b>&#8221; counting system).<span style="">&nbsp; </span></font></font></p>
<p><font face="Times New Roman">For example, let&#39;s say we have a document that is version &#8220;14.7&#8243;.<span style="">&nbsp; </span>Following the pattern and the base-512 counting system, we&#39;d come up with a number of &#8220;7175&#8243; (512 * 14 + 7) making the URL http://www.mydomain.com/_vti_history/7175/Shared%20Documents/Test.doc.</font></p>
<p><font face="Times New Roman">Now, I do have to state that <b style="mso-bidi-font-weight:normal;">I absolutely despise mathematics</b>.<span style="">&nbsp; </span>I hate it with a passion.<span style="">&nbsp; </span>It always has been, and will continue to be, my worst subject and is the constant source of many-a-migraine<span style="">&nbsp;&nbsp; </span>This particular base-512 system threw me for a bit of a loop when attempting some of the coding for this, but in the end I was able to tame it somewhat and come up with a workable solution for the logic it was confusing me with.<br /></font></p>
<p><font face="Times New Roman">&nbsp;</font><font face="Times New Roman">&nbsp;</font><i style="mso-bidi-font-style:normal;"><span style="FONT-SIZE:18pt;"><font face="Times New Roman"><br />
&#8211; Logic?<span style="">&nbsp; </span>More of a fad if you ask me. &#8211;</font></span></i></p>
<p><font><font face="Times New Roman">So, now that we know how SharePoint deals with document versions, let&#39;s take a quick look at the logic that will be involved in copying the contents of one library to another (then we&#39;ll jump into the code and get this post over with</font><span style="FONT-FAMILY:Wingdings;mso-ascii-font-family:&#39;Times New Roman&#39;;mso-hansi-font-family:&#39;Times New Roman&#39;;mso-char-type:symbol;mso-symbol-font-family:Wingdings;"><span style="mso-char-type:symbol;mso-symbol-font-family:Wingdings;">J</span></span><font face="Times New Roman">).</font></font></p>
<p><font face="Times New Roman">First and foremost, since we&#39;ll be programming against SharePoint, we&#39;ll need to make sure we can get access to the objects available in its object model so make sure in your web project that you add in a reference to the SharePoint.dll (located in the ISAPI folder of the 12 hive).</font></p>
<p><font face="Times New Roman">The steps the program will take are this:</font></p>
<p style="MARGIN-LEFT:0.5in;TEXT-INDENT:-0.25in;mso-list:l3 level1 lfo5;tab-stops:list .5in;"><font face="Times New Roman"><span style="mso-list:Ignore;"><font>1.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><font>Enumerate all sites in the current web collection and populate the &#8220;source site&#8221; and &#8220;target site&#8221; dropdown lists.</font></font></p>
<p style="MARGIN-LEFT:1in;TEXT-INDENT:-0.25in;mso-list:l3 level2 lfo5;tab-stops:list 1.0in;"><font face="Times New Roman"><span style="mso-list:Ignore;"><font>a.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><font>For this, I&#39;m adding in a parsed version of the site&#39;s URL into the text field of the list that has the domain portion of the URL removed only (makes it easier to read).</font></font></p>
<p style="MARGIN-LEFT:1in;TEXT-INDENT:-0.25in;mso-list:l3 level2 lfo5;tab-stops:list 1.0in;"><span style="mso-list:Ignore;"><font face="Times New Roman"><font>b.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Times New Roman">In the &#8220;value&#8221; attribute I&#39;m adding in the full URL.</p>
<p></font></p>
<p style="MARGIN-LEFT:0.5in;TEXT-INDENT:-0.25in;mso-list:l3 level1 lfo5;tab-stops:list .5in;"><font face="Times New Roman"><span style="mso-list:Ignore;"><font>2.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><font>On selection of the source or target site, the corresponding source or target &#8220;library&#8221; dropdowns get populated with a list of all the document libraries in the selected site.</font></font></p>
<p style="MARGIN-LEFT:1in;TEXT-INDENT:-0.25in;mso-list:l3 level2 lfo5;tab-stops:list 1.0in;"><font face="Times New Roman"><span style="mso-list:Ignore;"><font>a.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><font>Allows us to build the connection for the document library to be copied and its destination.</font></font></p>
<p style="MARGIN-LEFT:1in;TEXT-INDENT:-0.25in;mso-list:l3 level2 lfo5;tab-stops:list 1.0in;"><span style="mso-list:Ignore;"><font face="Times New Roman"><font>b.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Times New Roman">Additionally, I&#39;m trimming the list of available libraries down to (standard) user-accessible libraries only (removing libraries such as the &#8220;Master Page Gallery&#8221;, &#8220;Workflows&#8221;, etc.)</p>
<p></font></p>
<p style="MARGIN-LEFT:0.5in;TEXT-INDENT:-0.25in;mso-list:l3 level1 lfo5;tab-stops:list .5in;"><font face="Times New Roman"><span style="mso-list:Ignore;"><font>3.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><font>Next, after selection of the source and target have been established, on the button click event, we begin to format the URL&#39;s we&#39;ll need, setup our connections, then begin to enumerate the documents in the source library and process them.</font></font></p>
<p style="MARGIN-LEFT:1in;TEXT-INDENT:-0.25in;mso-list:l3 level2 lfo5;tab-stops:list 1.0in;"><font face="Times New Roman"><span style="mso-list:Ignore;"><font>a.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><font>During the document processing, there&#39;s a specific approach that had to be taken due to how the documents are stored and accessed as follows:</font></font></p>
<p style="MARGIN-LEFT:1in;TEXT-INDENT:-0.25in;mso-list:l3 level2 lfo5;tab-stops:list 1.0in;"><font face="Times New Roman"><span style="mso-list:Ignore;"><font>b.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><font>For each document in the library, check to see if it has any versions and if it does, grab it&#39;s URL and parse out the version number (the &#8220;base-512&#8243; number mentioned earlier) and add it to a new SortedList object as a key with no value (we&#39;ll use this is a comparison object later) making sure to <b style="mso-bidi-font-weight:normal;">first convert it to an integer</b>.</font></font></p>
<p style="MARGIN-LEFT:1.5in;TEXT-INDENT:-1.5in;mso-list:l3 level3 lfo5;tab-stops:list 1.5in;mso-text-indent-alt:-9.0pt;"><span style="mso-list:Ignore;"><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><font face="Times New Roman"><font>i.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font><font face="Times New Roman">Converting to an integer is actually a rather important step during this process that threw for awhile until I figured out what was happening.<span style="">&nbsp; </span>The SortedList object in .NET does perform automatic sorting on its keys (part of the appeal of the object), but it does treat the keys different depending on the type being entered.<span style="">&nbsp; </span>Since it&#39;s essentially a combination between an Array and a HashTable, it will take any object type you want to add, but adding in the parsed URL as a string has an inherent problem.<span style="">&nbsp; </span></p>
<p>If we add in for example, the following values: &#8220;1&#8243;, &#8220;2&#8243;, &#8220;512&#8243;, &#8220;1024&#8243;, they will actually be sorted in the list as &#8220;1&#8243;, &#8220;1024&#8243;, 2&#8243;, &#8220;512&#8243;.<span style="">&nbsp; </span>This is not good!<span style="">&nbsp; </span>Since we&#39;re working with versions, they must be in a specific order, and as described earlier in this post, the numbers follow a set pattern.<span style="">&nbsp; </span>Having them sorted based on the string sorting will make it so our copied versions will go to the new library in the wrong order (very bad</font><span style="FONT-FAMILY:Wingdings;mso-ascii-font-family:&#39;Times New Roman&#39;;mso-hansi-font-family:&#39;Times New Roman&#39;;mso-char-type:symbol;mso-symbol-font-family:Wingdings;"><span style="mso-char-type:symbol;mso-symbol-font-family:Wingdings;">L</span></span><font face="Times New Roman">).<span style="">&nbsp; </span>So, in order to have them sorted in the correct &#8220;numerical&#8221; order &#8211; convert the string number to an integer and all will be fine (finding this out took almost as long as writing the entire program itself).</font></font></p>
<p style="MARGIN-LEFT:1in;TEXT-INDENT:-0.25in;mso-list:l3 level2 lfo5;tab-stops:list 1.0in;"><font face="Times New Roman"><span style="mso-list:Ignore;"><font>c.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><font>Next, for each of the keys we just added, we&#39;ll again loop through all the versions, again parse out the version number from the URL and find the one that matches the key.</font></font></p>
<p style="MARGIN-LEFT:1in;TEXT-INDENT:-0.25in;mso-list:l3 level2 lfo5;tab-stops:list 1.0in;"><font face="Times New Roman"><span style="mso-list:Ignore;"><font>d.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><font>Once we have a match, we&#39;ll send the parsed out number (<b style="mso-bidi-font-weight:normal;">converted to an integer again</b>) to a custom &#8220;version checking&#8221; method that looks to see if it is a minor or major version and adds it into the target document library as the appropriate version.</font></font></p>
<p style="MARGIN-LEFT:1.5in;TEXT-INDENT:-1.5in;mso-list:l3 level3 lfo5;tab-stops:list 1.5in;mso-text-indent-alt:-9.0pt;"><span style="mso-list:Ignore;"><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><font face="Times New Roman"><font>i.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Times New Roman">In this method, a couple actions take place.</font></p>
<p style="MARGIN-LEFT:2in;TEXT-INDENT:-0.25in;mso-list:l3 level4 lfo5;tab-stops:list 2.0in;"><font face="Times New Roman"><span style="mso-list:Ignore;"><font>1.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><font>In order to have an adequate checking system for versions that would allow me to be able to pass in any version number regardless of how large, I had to process the integer through a simple base-512 check ( I say &#8220;simple&#8221; only because after the time it took me to figure out how to do it, it wound up only being three small lines of code to process the number and then a simple &#8220;if/else&#8221; to check if it was a major or minor.<b style="mso-bidi-font-weight:normal;">did I mention earlier how much I hate Math?!?!</b> </font></font><font><span style="FONT-FAMILY:Wingdings;mso-ascii-font-family:&#39;Times New Roman&#39;;mso-hansi-font-family:&#39;Times New Roman&#39;;mso-char-type:symbol;mso-symbol-font-family:Wingdings;"><span style="mso-char-type:symbol;mso-symbol-font-family:Wingdings;">L</span></span><font face="Times New Roman">).</font></font></p>
<p style="MARGIN-LEFT:2in;TEXT-INDENT:-0.25in;mso-list:l3 level4 lfo5;tab-stops:list 2.0in;"><font face="Times New Roman"><span style="mso-list:Ignore;"><font>2.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><font>Once the number has been processed and deemed either major or minor, it is then added to the target document library with the appropriate version.<span style="">&nbsp; </span>(Since versioning will be turned on in the target library, as I add in each successive version, the number will increment accordingly.)</font></font></p>
<p style="MARGIN-LEFT:1in;TEXT-INDENT:-0.25in;mso-list:l3 level2 lfo5;tab-stops:list 1.0in;"><font face="Times New Roman"><span style="mso-list:Ignore;"><font>e.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><font>Once all the versions have been added, the last step is to then add the current version of the document.</font></font></p>
<p style="MARGIN-LEFT:1.5in;TEXT-INDENT:-1.5in;mso-list:l3 level3 lfo5;tab-stops:list 1.5in;mso-text-indent-alt:-9.0pt;"><span style="mso-list:Ignore;"><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><font face="Times New Roman"><font>i.</font><span style="FONT:7pt &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Times New Roman">Since we already have the context of the current document during this entire process, this part is simply running a check to see if the current version is major or minor version then adding it to the target library and publishing it if it&#39;s a major version.</font></p>
<p><font face="Times New Roman">&nbsp;</font> </p>
<p><font face="Times New Roman">So, that&#39;s it.<span style="">&nbsp; </span>Not too complicated, just a logical step by step process to grab each document, process it for a few checks, the copy it to a target library.<span style="">&nbsp; </span>Here&#39;s the code to do all this:</font></p>
<p><font face="Times New Roman">(Note &#8211; There are of course, ways in which the code can be streamlined and made more efficient, but for the sake of this exercise, it should serve as the foundation for what you can build on to suit your needs.)</font></p>
<p><font face="Times New Roman">&nbsp;</font> </p>
<p><font face="Times New Roman">Html for &#8220;Default.aspx&#8221;:</font></p>
<p><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;">&lt;%<span style="COLOR:blue;">@</span> <span style="COLOR:#a31515;">Page</span> <span style="COLOR:red;">Language</span><span style="COLOR:blue;">=&quot;C#&quot;</span> <span style="COLOR:red;">AutoEventWireup</span><span style="COLOR:blue;">=&quot;true&quot;</span> <span style="COLOR:red;">CodeFile</span><span style="COLOR:blue;">=&quot;Default.aspx.cs&quot;</span> <span style="COLOR:red;">Inherits</span><span style="COLOR:blue;">=&quot;_Default&quot;</span> %&gt;<br /><span style="COLOR:blue;">&lt;!</span><span style="COLOR:#a31515;">DOCTYPE</span> <span style="COLOR:red;">html</span> <span style="COLOR:red;">PUBLIC</span> <span style="COLOR:blue;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="COLOR:blue;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;<br />&lt;</span><span style="COLOR:#a31515;">html </span><span style="COLOR:red;">xmlns</span><span style="COLOR:blue;">=&quot;http://www.w3.org/1999/xhtml&quot;</span> <span style="COLOR:blue;">&gt;<br />&lt;</span><span style="COLOR:#a31515;">head</span> <span style="COLOR:red;">runat</span><span style="COLOR:blue;">=&quot;server&quot;&gt;<br />&lt;</span><span style="COLOR:#a31515;">title</span><span style="COLOR:blue;">&gt;</span>Copy document library contents<span style="COLOR:blue;">&lt;/</span><span style="COLOR:#a31515;">title</span><span style="COLOR:blue;">&gt;<br />&lt;/</span><span style="COLOR:#a31515;">head</span><span style="COLOR:blue;">&gt;<br />&lt;</span><span style="COLOR:#a31515;">body</span><span style="COLOR:blue;">&gt;<br />&nbsp; &lt;</span><span style="COLOR:#a31515;">form</span> <span style="COLOR:red;">id</span><span style="COLOR:blue;">=&quot;form1&quot;</span> <span style="COLOR:red;">runat</span><span style="COLOR:blue;">=&quot;server&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">table</span> <span style="COLOR:red;">id</span><span style="COLOR:blue;">=&quot;tblMain&quot;</span> <span style="COLOR:red;">runat</span><span style="COLOR:blue;">=&quot;server&quot;&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">tr</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">Label</span> <span style="COLOR:red;">ID</span><span style="COLOR:blue;">=&quot;lblSourceSite&quot;</span> <span style="COLOR:red;">runat</span><span style="COLOR:blue;">=&quot;server&quot;</span> <span style="COLOR:red;">Text</span><span style="COLOR:blue;">=&quot;Source Site:&quot;</span> <span style="COLOR:red;">Width</span><span style="COLOR:blue;">=&quot;115px&quot;&gt;&lt;/</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">Label</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">Label</span> <span style="COLOR:red;">ID</span><span style="COLOR:blue;">=&quot;lblSourceLib&quot;</span> <span style="COLOR:red;">runat</span><span style="COLOR:blue;">=&quot;server&quot;</span> <span style="COLOR:red;">Text</span><span style="COLOR:blue;">=&quot;Source Library:&quot;</span> <span style="COLOR:red;">Width</span><span style="COLOR:blue;">=&quot;115px&quot;&gt;&lt;/</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">Label</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/</span><span style="COLOR:#a31515;">tr</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">tr</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">DropDownList</span> <span style="COLOR:red;">ID</span><span style="COLOR:blue;">=&quot;ddlSourceSite&quot;</span> <span style="COLOR:red;">runat</span><span style="COLOR:blue;">=&quot;server&quot;</span> <span style="COLOR:red;">AutoPostBack</span><span style="COLOR:blue;">=&quot;True&quot;</span> <span style="COLOR:red;">OnSelectedIndexChanged</span><span style="COLOR:blue;">=&quot;ddlSourceSite_SelectedIndexChanged&quot;&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">ListItem</span><span style="COLOR:blue;">&gt;</span>&#8211; Choose Site &#8211;<span style="COLOR:blue;">&lt;/</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">ListItem</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">DropDownList</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">DropDownList</span> <span style="COLOR:red;">ID</span><span style="COLOR:blue;">=&quot;ddlSourceLib&quot;</span> <span style="COLOR:red;">runat</span><span style="COLOR:blue;">=&quot;server&quot;</span> <span style="COLOR:red;">AutoPostBack</span><span style="COLOR:blue;">=&quot;True&quot;&gt;&lt;/</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">DropDownList</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">tr</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">tr</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">Label</span> <span style="COLOR:red;">ID</span><span style="COLOR:blue;">=&quot;lblTargSite&quot;</span> <span style="COLOR:red;">runat</span><span style="COLOR:blue;">=&quot;server&quot;</span> <span style="COLOR:red;">Text</span><span style="COLOR:blue;">=&quot;Target Site:&quot;</span> <span style="COLOR:red;">Width</span><span style="COLOR:blue;">=&quot;115px&quot;&gt;&lt;/</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">Label</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">Label</span> <span style="COLOR:red;">ID</span><span style="COLOR:blue;">=&quot;lblTargLib&quot;</span> <span style="COLOR:red;">runat</span><span style="COLOR:blue;">=&quot;server&quot;</span> <span style="COLOR:red;">Text</span><span style="COLOR:blue;">=&quot;Target Library:&quot;</span> <span style="COLOR:red;">Width</span><span style="COLOR:blue;">=&quot;115px&quot;&gt;&lt;/</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">Label</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">tr</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">tr</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">DropDownList</span> <span style="COLOR:red;">ID</span><span style="COLOR:blue;">=&quot;ddlTargSite&quot;</span> <span style="COLOR:red;">runat</span><span style="COLOR:blue;">=&quot;server&quot;</span> <span style="COLOR:red;">AutoPostBack</span><span style="COLOR:blue;">=&quot;True&quot;</span> <span style="COLOR:red;">OnSelectedIndexChanged</span><span style="COLOR:blue;">=&quot;ddlTargSite_SelectedIndexChanged&quot;&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">ListItem</span><span style="COLOR:blue;">&gt;</span>&#8211; Choose Site &#8211;<span style="COLOR:blue;">&lt;/</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">ListItem</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">DropDownList</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">DropDownList</span> <span style="COLOR:red;">ID</span><span style="COLOR:blue;">=&quot;ddlTargLib&quot;</span> <span style="COLOR:red;">runat</span><span style="COLOR:blue;">=&quot;server&quot;</span> <span style="COLOR:red;">AutoPostBack</span><span style="COLOR:blue;">=&quot;True&quot;&gt;&lt;/</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">DropDownList</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">tr</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">tr</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">Button</span> <span style="COLOR:red;">ID</span><span style="COLOR:blue;">=&quot;btnStart&quot;</span> <span style="COLOR:red;">runat</span><span style="COLOR:blue;">=&quot;server&quot;</span> <span style="COLOR:red;">OnClick</span><span style="COLOR:blue;">=&quot;btnStart_Click&quot;</span> <span style="COLOR:red;">Text</span><span style="COLOR:blue;">=&quot;Copy Files&quot;</span> <span style="COLOR:blue;">/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="COLOR:#a31515;">asp</span><span style="COLOR:blue;">:</span><span style="COLOR:#a31515;">Button</span> <span style="COLOR:red;">ID</span><span style="COLOR:blue;">=&quot;btnReset&quot;</span> <span style="COLOR:red;">runat</span><span style="COLOR:blue;">=&quot;server&quot;</span> <span style="COLOR:red;">Text</span><span style="COLOR:blue;">=&quot;Reset Fields&quot;</span> <span style="COLOR:red;">OnClick</span><span style="COLOR:blue;">=&quot;btnReset_Click&quot;</span> <span style="COLOR:blue;">/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">td</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">tr</span><span style="COLOR:blue;">&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/</span><span style="COLOR:#a31515;">table</span><span style="COLOR:blue;">&gt;<br />&nbsp; &lt;/</span><span style="COLOR:#a31515;">form</span><span style="COLOR:blue;">&gt;<br />&lt;/</span><span style="COLOR:#a31515;">body</span><span style="COLOR:blue;">&gt; <br />&lt;/</span><span style="COLOR:#a31515;">html</span><span style="COLOR:blue;">&gt;</span></span><font face="Times New Roman">&nbsp;</font> </p>
<p><font face="Times New Roman">The corresponding &#8220;Default.aspx.cs&#8221; file will be as follows:</font></p>
<p><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">using</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"> System;<br /><span style="COLOR:blue;">using</span> System.Collections;<br /><span style="COLOR:blue;">using</span> System.Text.RegularExpressions;<br /><span style="COLOR:blue;">using</span> Microsoft.SharePoint;<br /><span style="COLOR:blue;">using</span> Microsoft.SharePoint.Administration;<br /><span style="COLOR:blue;">using</span> Microsoft.SharePoint.Utilities;<br /><span style="COLOR:blue;">using</span> Microsoft.SharePoint.WebControls;<br /><span style="COLOR:blue;">using</span> System.Web;<br /><span style="COLOR:blue;">using</span> System.Web.UI;<br /><span style="COLOR:blue;">using</span> System.Web.UI.HtmlControls;<br /><span style="COLOR:blue;">using</span> System.Web.UI.WebControls; </span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">public</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"> <span style="COLOR:blue;">partial</span> <span style="COLOR:blue;">class</span> <span style="COLOR:#2b91af;">_Default</span> : System.Web.UI.<span style="COLOR:#2b91af;">Page<br /></span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; #region</span> GlobalVars<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; string</span> sourceFolder; <span style="COLOR:green;">//source site<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; string</span> sourceDocLib; <span style="COLOR:green;">//source library<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; string</span> destFolder; <span style="COLOR:green;">//target site<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; string</span> destDocLib; <span style="COLOR:green;">//target library<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; string</span> destURL = <span style="COLOR:#a31515;">&quot;&quot;</span>; <span style="COLOR:green;">//target site + library + filename<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:#2b91af;">SPSite</span> siteCollection;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:#2b91af;">SPFolder</span> srcFolder;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:#2b91af;">SPFileCollection</span> destFiles;&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:#2b91af;">SPWebApplication</span> webApp;&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; byte</span>[] verFile; <span style="COLOR:green;">//document to be copied<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; #endregion&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;summary&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> Page load event that calls method to populate dropdownlists<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;/summary&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;param name=&quot;sender&quot;&gt;&lt;/param&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;param name=&quot;e&quot;&gt;&lt;/param&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; protected</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"> <span style="COLOR:blue;">void</span> Page_Load(<span style="COLOR:blue;">object</span> sender, <span style="COLOR:#2b91af;">EventArgs</span> e)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>GetSites();<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span>}&nbsp;<span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:gray;">///</span><span style="COLOR:green;"> </span><span style="COLOR:gray;">&lt;summary&gt;<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:gray;">///</span><span style="COLOR:green;"> Populates source and target (site) dropdownlists<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:gray;">///</span><span style="COLOR:green;"> </span><span style="COLOR:gray;">&lt;/summary&gt;<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; public</span> <span style="COLOR:blue;">void</span> GetSites()&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:#2b91af;">SPSite</span> mySite = <span style="COLOR:#2b91af;">SPContext</span>.Current.Site;&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:#2b91af;">SPWebCollection</span> subSites = mySite.AllWebs;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach</span> (<span style="COLOR:#2b91af;">SPWeb</span> site <span style="COLOR:blue;">in</span> subSites)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="COLOR:green;">//regex to strip out&nbsp;the domain name from the URL &#8211; makes it display nice in the dropdownlist<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //also, make sure to&nbsp;use your own domain name&nbsp;escape the &quot;/&quot; from the end of the domain<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>ddlSourceSite.Items.Add(<span style="COLOR:blue;">new</span> <span style="COLOR:#2b91af;">ListItem</span>(<span style="COLOR:#2b91af;">Regex</span>.Replace(site.Url, <span style="COLOR:#a31515;">&quot;yourdomain.com\/&quot;</span>, <span style="COLOR:#a31515;">&quot;&quot;</span>), site.Url));<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>ddlTargSite.Items.Add(<span style="COLOR:blue;">new</span> <span style="COLOR:#2b91af;">ListItem</span>(<span style="COLOR:#2b91af;">Regex</span>.Replace site.Url, <span style="COLOR:#a31515;">&quot;your domain.com\/&quot;</span>, <span style="COLOR:#a31515;">&quot;&quot;</span>), site.Url));&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span>} </span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;summary&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> Populates list of source document libraries and filters out &quot;admin&quot; libraries<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;/summary&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;param name=&quot;sender&quot;&gt;&lt;/param&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;param name=&quot;e&quot;&gt;&lt;/param&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; protected</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"> <span style="COLOR:blue;">void</span> ddlSourceSite_SelectedIndexChanged(<span style="COLOR:blue;">object</span> sender, <span style="COLOR:#2b91af;">EventArgs</span> e)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>ddlSourceLib.Items.Clear();</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using</span> (<span style="COLOR:#2b91af;">SPSite</span> curSite = <span style="COLOR:blue;">new</span> <span style="COLOR:#2b91af;">SPSite</span>(ddlSourceSite.SelectedItem.Value))&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using</span> (<span style="COLOR:#2b91af;">SPWeb</span> curWeb = curSite.OpenWeb())&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach</span> (<span style="COLOR:#2b91af;">SPList</span> list <span style="COLOR:blue;">in</span> curWeb.Lists)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if</span> (list.Title == <span style="COLOR:#a31515;">&quot;List Template Gallery&quot;</span> || list.Title == <span style="COLOR:#a31515;">&quot;Master Page Gallery&quot;</span> || list.Title == <span style="COLOR:#a31515;">&quot;Site Template Gallery&quot;</span> || list.Title == <span style="COLOR:#a31515;">&quot;Web Part Gallery&quot;</span> || list.Title == <span style="COLOR:#a31515;">&quot;Workflows&quot;</span>)<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span> <span style="COLOR:blue;">if</span> (list.GetType().ToString() == <span style="COLOR:#a31515;">&quot;Microsoft.SharePoint.SPDocumentLibrary&quot;</span>)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>ddlSourceLib.Items.Add(<span style="COLOR:blue;">new</span> <span style="COLOR:#2b91af;">ListItem</span>(list.Title));&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span>}&nbsp;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:gray;">///</span><span style="COLOR:green;"> </span><span style="COLOR:gray;">&lt;summary&gt;<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:gray;">///</span><span style="COLOR:green;"> Populates list of target document libraries and filters out &quot;admin&quot; libraries<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:gray;">///</span><span style="COLOR:green;"> </span><span style="COLOR:gray;">&lt;/summary&gt;<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:gray;">///</span><span style="COLOR:green;"> </span><span style="COLOR:gray;">&lt;param name=&quot;sender&quot;&gt;&lt;/param&gt;<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:gray;">///</span><span style="COLOR:green;"> </span><span style="COLOR:gray;">&lt;param name=&quot;e&quot;&gt;&lt;/param&gt;<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; protected</span> <span style="COLOR:blue;">void</span> ddlTargSite_SelectedIndexChanged(<span style="COLOR:blue;">object</span> sender, <span style="COLOR:#2b91af;">EventArgs</span> e)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>ddlTargLib.Items.Clear();</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using</span> (<span style="COLOR:#2b91af;">SPSite</span> curSite = <span style="COLOR:blue;">new</span> <span style="COLOR:#2b91af;">SPSite</span>(ddlTargSite.SelectedItem.Value))&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using</span> (<span style="COLOR:#2b91af;">SPWeb</span> curWeb = curSite.OpenWeb())&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach</span> (<span style="COLOR:#2b91af;">SPList</span> list <span style="COLOR:blue;">in</span> curWeb.Lists)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if</span> (list.Title == <span style="COLOR:#a31515;">&quot;List Template Gallery&quot;</span> || list.Title == <span style="COLOR:#a31515;">&quot;Master Page Gallery&quot;</span> || list.Title == <span style="COLOR:#a31515;">&quot;Site Template Gallery&quot;</span> || list.Title == <span style="COLOR:#a31515;">&quot;Web Part Gallery&quot;</span> || list.Title == <span style="COLOR:#a31515;">&quot;Workflows&quot;</span>)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span> <span style="COLOR:blue;">if</span> (list.GetType().ToString() == <span style="COLOR:#a31515;">&quot;Microsoft.SharePoint.SPDocumentLibrary&quot;</span>)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>ddlTargLib.Items.Add(<span style="COLOR:blue;">new</span> <span style="COLOR:#2b91af;">ListItem</span>(list.Title));&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span>}&nbsp;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:gray;">///</span><span style="COLOR:green;"> </span><span style="COLOR:gray;">&lt;summary&gt;<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:gray;">///</span><span style="COLOR:green;"> Gathers selections from dropdownlists and fires off copy process<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:gray;">///</span><span style="COLOR:green;"> </span><span style="COLOR:gray;">&lt;/summary&gt;<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:gray;">///</span><span style="COLOR:green;"> </span><span style="COLOR:gray;">&lt;param name=&quot;sender&quot;&gt;&lt;/param&gt;<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:gray;">///</span><span style="COLOR:green;"> </span><span style="COLOR:gray;">&lt;param name=&quot;e&quot;&gt;&lt;/param&gt;<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; protected</span> <span style="COLOR:blue;">void</span> btnStart_Click(<span style="COLOR:blue;">object</span> sender, <span style="COLOR:#2b91af;">EventArgs</span> e)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//set paths &#8211; parses out site name from url in dropdownlists<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string</span> sf = ddlSourceSite.SelectedItem.Text;&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int</span> index0 = sf.LastIndexOf(<span style="COLOR:#a31515;">&quot;/&quot;</span>);<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string</span> newSf = sf.Substring(index0 + 1);&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>sourceFolder = newSf;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string</span> sd = ddlSourceLib.SelectedItem.Text;&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int</span> index1 = sd.LastIndexOf(<span style="COLOR:#a31515;">&quot;/&quot;</span>);<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string</span> newSd = sd.Substring(index1 + 1);&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>sourceDocLib = newSd;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string</span> df = ddlTargSite.SelectedItem.Text;&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int</span> index2 = df.LastIndexOf(<span style="COLOR:#a31515;">&quot;/&quot;</span>);<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string</span> newDf = df.Substring(index2 + 1);&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>destFolder = newDf;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string</span> dd = ddlTargLib.SelectedItem.Text;&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int</span> index3 = dd.LastIndexOf(<span style="COLOR:#a31515;">&quot;/&quot;</span>);<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string</span> newDd = dd.Substring(index3 + 1);&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>destDocLib = newDd;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//connection info and context<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>siteCollection = <span style="COLOR:#2b91af;">SPControl</span>.GetContextSite(Context);&nbsp;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//source folder (document library)<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>srcFolder = siteCollection.AllWebs[sourceFolder].Folders[sourceDocLib];</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//destination folder (document library)<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>destFiles = siteCollection.AllWebs[destFolder].Folders[destDocLib].Files;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//Admin web application object<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>webApp = siteCollection.WebApplication;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//temporarily disables &quot;security validation&quot; to get around the<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//&quot;The security validation for this page is invalid.&quot; error message<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>webApp.FormDigestSettings.Enabled = <span style="COLOR:blue;">false</span>;&nbsp;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//enumerate source library<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach</span> (<span style="COLOR:#2b91af;">SPFile</span> file <span style="COLOR:blue;">in</span> srcFolder.Files)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//standard check<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if</span> (file.Exists)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//custom sorted list used to reorder versions<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:#2b91af;">SortedList</span> myList = <span style="COLOR:blue;">new</span> <span style="COLOR:#2b91af;">SortedList</span>();&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:#2b91af;">ICollection</span> items = myList.Keys;&nbsp;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//destination URL &#8211; path that will be used for copied file to target library including filename<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>destURL = destFiles.Folder.Url + <span style="COLOR:#a31515;">&quot;/&quot;</span> + file.Name;&nbsp;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//checks to see if file has versions<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if</span> (file.Versions.Count != 0)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//enumerate versions<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach</span> (<span style="COLOR:#2b91af;">SPFileVersion</span> ver <span style="COLOR:blue;">in</span> file.Versions)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string</span> tempKey = <span style="COLOR:#a31515;">&quot;&quot;</span>;&nbsp;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//parses version number from previous versions URL<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>tempKey = <span style="COLOR:#2b91af;">Regex</span>.Replace(ver.Url, <span style="COLOR:#a31515;">&quot;_vti_history/&quot;</span>, <span style="COLOR:#a31515;">&quot;&quot;</span>);&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>tempKey = <span style="COLOR:#2b91af;">Regex</span>.Replace(tempKey, <span style="COLOR:#a31515;">&quot;/&quot;</span> + sourceDocLib, <span style="COLOR:#a31515;">&quot;&quot;</span>);<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>tempKey = <span style="COLOR:#2b91af;">Regex</span>.Replace(tempKey, <span style="COLOR:#a31515;">&quot;/&quot;</span> + file.Name, <span style="COLOR:#a31515;">&quot;&quot;</span>);&nbsp;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//converts string number to int in order to be sorted correctly<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//adds to Sorted list as a new key<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>myList.Add(<span style="COLOR:blue;">int</span>.Parse(tempKey), <span style="COLOR:#a31515;">&quot;&quot;</span>);&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//since items in sorted list are now actually sorted correctly<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//we start with this list in order to process the versions<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//to copy them in the correct order<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach</span> (<span style="COLOR:blue;">object</span> key <span style="COLOR:blue;">in</span> items)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//as we iterate the keys in the sorted list (the version numbers)<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//we then run a comparison on the actual versions to find which one matches<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//the key so we can process each one in order<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach</span> (<span style="COLOR:#2b91af;">SPFileVersion</span> newVer <span style="COLOR:blue;">in</span> file.Versions)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string</span> temp = <span style="COLOR:#a31515;">&quot;&quot;</span>;&nbsp;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//parses version number from previous versions URL again&nbsp;<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//in order to compare it to key stored in SortedList.<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>temp = <span style="COLOR:#2b91af;">Regex</span>.Replace(newVer.Url, <span style="COLOR:#a31515;">&quot;_vti_history/&quot;</span>, <span style="COLOR:#a31515;">&quot;&quot;</span>);&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>temp = <span style="COLOR:#2b91af;">Regex</span>.Replace(temp, <span style="COLOR:#a31515;">&quot;/&quot;</span> + sourceDocLib, <span style="COLOR:#a31515;">&quot;&quot;</span>);<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>temp = <span style="COLOR:#2b91af;">Regex</span>.Replace(temp, <span style="COLOR:#a31515;">&quot;/&quot;</span> + file.Name, <span style="COLOR:#a31515;">&quot;&quot;</span>);&nbsp;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//checks to see if version matches key&nbsp;<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if</span> (temp == key.ToString())&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//opens file for processing and calls method to determine major/minor status<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>verFile = newVer.OpenBinary();<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>SetVersion(<span style="COLOR:blue;">int</span>.Parse(temp));&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//Last step which copies current version<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; byte</span>[] binFile;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:#2b91af;">SPFile</span> copyFile;&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>binFile = file.OpenBinary();</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//checks if current version is major/minor version and publishes accordingly<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if</span> (file.Level.ToString() == <span style="COLOR:#a31515;">&quot;Published&quot;</span>)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>copyFile = destFiles.Add(destURL, binFile, <span style="COLOR:blue;">true</span>);<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>copyFile.Publish(<span style="COLOR:#a31515;">&quot;&quot;</span>);&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>copyFile = destFiles.Add(destURL, binFile, <span style="COLOR:blue;">true</span>);&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//re-enables &quot;security validation&quot;<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>webApp.FormDigestSettings.Enabled = <span style="COLOR:blue;">true</span>;&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span>} </span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;summary&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> method to determine major/minor status<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> of version and publish accordingly<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;/summary&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;param name=&quot;num&quot;&gt;</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;">parsed version number from file&#39;s URL</span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;/param&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; public</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"> <span style="COLOR:blue;">void</span> SetVersion(<span style="COLOR:blue;">int</span> num)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int</span> baseNum = 512;&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; decimal</span> d = num / baseNum;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int</span> i = (<span style="COLOR:blue;">int</span>)<span style="COLOR:#2b91af;">Math</span>.Floor(d) * 512;&nbsp;</p>
<p><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//major publish (eg 1.0, 2.0, 3.0)<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if</span> (num == i)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:#2b91af;">SPFile</span> copFileVers = destFiles.Add(destURL, verFile, <span style="COLOR:blue;">true</span>);<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>copFileVers.Publish(<span style="COLOR:#a31515;">&quot;&quot;</span>);&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:green;">//minor (eg 0.1, 1.1, 2.3)<br /></span><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR:#2b91af;">SPFile</span> copFileVers = destFiles.Add(destURL, verFile, <span style="COLOR:blue;">true</span>);&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span>} </span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;summary&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> Resets dropdowns<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;/summary&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;param name=&quot;sender&quot;&gt;&lt;/param&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">///</span><span style="FONT-SIZE:10pt;COLOR:green;FONT-FAMILY:&#39;Courier New&#39;;"> </span><span style="FONT-SIZE:10pt;COLOR:gray;FONT-FAMILY:&#39;Courier New&#39;;">&lt;param name=&quot;e&quot;&gt;&lt;/param&gt;<br /></span><span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;&nbsp;&nbsp;&nbsp; protected</span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;"> <span style="COLOR:blue;">void</span> btnReset_Click(<span style="COLOR:blue;">object</span> sender, <span style="COLOR:#2b91af;">EventArgs</span> e)&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Response.Redirect(<span style="COLOR:#a31515;">&quot;default.aspx&quot;</span>);&nbsp;<br /><span style="COLOR:blue;">&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br />}</p>
<p></span><span style="FONT-SIZE:10pt;FONT-FAMILY:&#39;Courier New&#39;;">&nbsp;</span><i style="mso-bidi-font-style:normal;"><span style="FONT-SIZE:18pt;"><font face="Times New Roman"><br />
&#8211; Conclusion &#8211;</font></span></i></p>
<p><font face="Times New Roman">In order to get this to work:</font></p>
<ul>
<li style="MARGIN:0in 0in 0pt;mso-list:l0 level1 lfo1;tab-stops:list .5in;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"><font face="Times New Roman">Modify the &#8220;GetSites&#8221; method to strip out your domain instead of the &#8220;yourdomain.com&#8221; sample listed.</font></li>
<li style="MARGIN:0in 0in 0pt;mso-list:l0 level1 lfo1;tab-stops:list .5in;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"><font face="Times New Roman">Build and deploy using your preferred method (&quot;layouts&quot; directory, IIS site and view with page viewer, etc.)</font></li>
<li style="MARGIN:0in 0in 0pt;mso-list:l0 level1 lfo1;tab-stops:list .5in;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;"><font><font face="Times New Roman">Run the app and enjoy </font><span style="FONT-FAMILY:Wingdings;mso-ascii-font-family:&#39;Times New Roman&#39;;mso-hansi-font-family:&#39;Times New Roman&#39;;mso-char-type:symbol;mso-symbol-font-family:Wingdings;"><span style="mso-char-type:symbol;mso-symbol-font-family:Wingdings;">J</span></span></font></li>
</ul>
<p><font face="Times New Roman">Due to the length of this post it is also very possible that I may have inadvertently skipped something, or possibly even typo&#39;d in some area that may be rather important.&nbsp; If you see something obvious, please add a comment and I&#39;ll make sure and fix it as soon as I can.&nbsp; Also, if anyone has any issue with getting the code to work, again please post a comment to that effect and we&#39;ll work through it to see if we can get things going.</font></p>
<p><font face="Times New Roman">Until next time,</font></p>
<p><font face="Times New Roman">- Dink</font></p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/dez/2007/11/30/moving-copying-documents-between-libraries-with-metadata-including-version-history/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Employee Training and Scheduling Template &#8211; a couple fixes Part 2</title>
		<link>http://vspug.com/dez/2007/09/19/employee-training-and-scheduling-template-a-couple-fixes-part-2/</link>
		<comments>http://vspug.com/dez/2007/09/19/employee-training-and-scheduling-template-a-couple-fixes-part-2/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 21:11:00 +0000</pubDate>
		<dc:creator>Dessie Lunsford</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[On the last post regarding this template (see Part 1), I gave a walkthrough on how to fix the &#34;Available Seats&#34; variable when a user unregisters from a course so that the variable would increment.
This time I&#39;m going to give a walkthrough on the simple fix to make it so when a user has registered [...]]]></description>
			<content:encoded><![CDATA[<p>On the last post regarding this template (see <a href="/dez/archive/2007/09/19/employee-training-and-scheduling-template-a-couple-fixes.aspx" title="Part 1">Part 1</a>), I gave a walkthrough on how to fix the &quot;Available Seats&quot; variable when a user unregisters from a course so that the variable would increment.</p>
<p>This time I&#39;m going to give a walkthrough on the simple fix to make it so when a user has registered for multiple courses, when they attempt to unregister from an event through the &quot;Courses I am attending&quot; webpart, they actually get removed from the correct course </p>
<p>There is an error in the XSL for the web part that makes it so when the &quot;Remove&quot; link is clicked, it choose whatever course is listed first and not the specific one that lines up with the &quot;remove&quot; link.</p>
<p><strong>For example:</strong>&nbsp; if you had three courses on the list and you clicked &quot;remove&quot; on the second one&#8230;it would actually remove you from the first&nbsp;course that was listed (because it was displayed first on the list)&nbsp;instead.</p>
<p>&nbsp;</p>
<p>The walkthrough for this is really pretty simple to do, so I&#39;m not going to use screenshots for this one&#8230;I&#39;ll just walk you through.</p>
<p>Open the &quot;XSL Editor&quot; for the &quot;Courses I am attending&quot; webpart.<br />Copy/paste the contents into NotePad (or editor of your choice).<br />Search for the &quot;remove&quot; link (it&#39;s in a &quot;td&quot; tag a little past halfway down in the document).<br />Replace the contents of the &quot;td&quot; with the following:</p>
<p><strong>Change from:</strong></p>
<p>&lt;td class=&quot;ms-vb&quot;&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;a href=&quot;Lists/Registrations/Unregister.aspx?ID={../../../Registrations/Rows/Row/@ID}&quot; mce_href=&quot;Lists/Registrations/Unregister.aspx?ID={../../../Registrations/Rows/Row/@ID}&quot;&gt;Remove&lt;/a&gt;<br />&lt;/td&gt;&nbsp;</p>
<p><strong>To:</strong></p>
<p>&lt;td class=&quot;ms-vb&quot;&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:variable name=&quot;CourseID&quot; select=&quot;@ID&quot;/&gt;<br />&nbsp;&nbsp;&nbsp; &lt;a href=&quot;Lists/Registrations/Unregister.aspx?ID={../../../Registrations/Rows/Row[@Course_x0020_ID=$CourseID and contains(@Author, $UserID)]/@ID}&quot;&gt;Remove&lt;/a&gt;<br />&lt;/td&gt;</p>
<p>This adds a section that will match up the &quot;Remove&quot; link to the ID of the actual listing and make the removal work correctly.</p>
<p>****Thanks to Yannis on MSDN Blogs to pointing out this fix.****</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/dez/2007/09/19/employee-training-and-scheduling-template-a-couple-fixes-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Employee Training and Scheduling Template &#8211; a couple fixes Part 1</title>
		<link>http://vspug.com/dez/2007/09/19/employee-training-and-scheduling-template-a-couple-fixes/</link>
		<comments>http://vspug.com/dez/2007/09/19/employee-training-and-scheduling-template-a-couple-fixes/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 20:02:00 +0000</pubDate>
		<dc:creator>Dessie Lunsford</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[The following is a walkthrough on how to manually adjust the default set of workflows built into the &#34;Employee Training Scheduling and Materials&#34; template to set the &#34;Attendee Unregistration&#34; workflow&#160;to work as intended.&#160; By default, the workflow does not increment the &#34;Available Seats&#34; variable when a user un-registers from a course, which can lead to [...]]]></description>
			<content:encoded><![CDATA[<p>The following is a walkthrough on how to manually adjust the default set of workflows built into the &quot;Employee Training Scheduling and Materials&quot; template to set the &quot;Attendee Unregistration&quot; workflow&nbsp;to work as intended.&nbsp; <strong>By default, the workflow does not increment the &quot;Available Seats&quot; variable when a user un-registers from a course</strong>, which can lead to issues in how many users can actually register if several &quot;un-registrations&quot; take place. </p>
<p>Walkthrough:</p>
<p>In SharePoint Designer:<br />File &gt; Open Site<br />Open to the Employee Training Site<br />Expand WorkFlows, expand Attendee Unregistration and double click &quot;Attendee Unregistration.xoml&quot;<br />The Workflow Designer for &quot;Unregister from course&quot; should display.<br />And the Delete item in Registration flow should display. Click on Actions &gt; More Actions<br />Double Click the &quot;Do Calculations&quot; to add it to the workflow.<br /><img title="Workflow Screen 1" style="WIDTH:741px;HEIGHT:584px;" height="584" alt="Workflow Screen 1" src="http://www.olympic.edu/images/sp/screen1.jpg" width="741" /></p>
<p>Open the drop down menu for this item and move it up twice, so it&#39;s the first item under &quot;Delete Item in Registration&quot;<br />Click the first &quot;value&quot; hyperlink and click the &quot;fx&quot; button next to it.<br />For the pop-ups, enter the information as follows:<br /><img title="workflow screen 2" style="WIDTH:378px;HEIGHT:273px;" height="273" alt="workflow screen 2" src="http://www.olympic.edu/images/sp/screen2.jpg" width="378" /> </p>
<p>Click the &quot;fx&quot; and fill out the following then click ok<br /><img title="workflow screen 3" alt="workflow screen 3" src="http://www.olympic.edu/images/sp/screen3.jpg" /> </p>
<p>Click on the &quot;plus&quot; hyperlink and change it to &quot;minus&quot;<br />Click on the 2<sup>nd</sup> &quot;value&quot; hyperlink and enter the number one (1).<br />Click on the &quot;Variable:calc&quot; hyperlink and select &quot;create new variable&quot; and enter a new name, make it a &quot;Number&quot; Type and click &quot;OK&quot;<br /><img title="workflow screen 4" style="WIDTH:197px;HEIGHT:180px;" height="180" alt="workflow screen 4" src="http://www.olympic.edu/images/sp/screen4.jpg" width="197" /> </p>
<p>The Workflow should now look something like this:<br /><img title="workflow screen 5" style="WIDTH:741px;HEIGHT:584px;" height="584" alt="workflow screen 5" src="http://www.olympic.edu/images/sp/screen5.jpg" width="741" /> </p>
<p>Click on the Actions button &gt; More Actions and add the &quot;Upldate List Item&quot; action.<br />Move this action up so it is under the action you just created above.<br />Click the &quot;this list&quot; hyperlink<br />Change List to : Courses<br />Click Add to fill out the Value Assignment<br /><img title="workflow screen 6" style="WIDTH:258px;HEIGHT:155px;" height="155" alt="workflow screen 6" src="http://www.olympic.edu/images/sp/screen6.jpg" width="258" /> </p>
<p>Click &quot;fx&quot; on the &quot;Value Assignment&quot; to get the &quot;Define Workflow Lookup&quot;<br /><img title="workflow screen 7" style="WIDTH:378px;HEIGHT:165px;" height="165" alt="workflow screen 7" src="http://www.olympic.edu/images/sp/screen7.jpg" width="378" /> </p>
<p>Value Assignment should look like this:<br /><img title="workflow screen 8" style="WIDTH:258px;HEIGHT:155px;" height="155" alt="workflow screen 8" src="http://www.olympic.edu/images/sp/screen8.jpg" width="258" /> </p>
<p>Ok out of Define Workflow Lookup and Ok out of Value Assignment<br />For the bottom half, choose Courses:ID for the field and then click &quot;fx&quot; to lookup the Value:<br /><img title="worflow screen 9" style="WIDTH:378px;HEIGHT:165px;" height="165" alt="worflow screen 9" src="http://www.olympic.edu/images/sp/screen9.jpg" width="378" /> </p>
<p>The Update List Item should look like this:<br /><img title="workflow screen 10" style="WIDTH:378px;HEIGHT:436px;" height="436" alt="workflow screen 10" src="http://www.olympic.edu/images/sp/screen10.jpg" width="378" /> </p>
<p>Ok out of the screen.<br />The updated Attendee Unregistration Workflow should look like this:<br /><img title="workflow screen 11" style="WIDTH:741px;HEIGHT:584px;" height="584" alt="workflow screen 11" src="http://www.olympic.edu/images/sp/screen11.jpg" width="741" /> </p>
<p>Finish to complete. The workflow should build. </p>
<p>****Special thanks to <a title="milayen" href="/members/milayen.aspx">milayen</a> from SharePointU.com for providing me this walkthrough when I needed it most, and allowing me to reproduce it here for you.****</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/dez/2007/09/19/employee-training-and-scheduling-template-a-couple-fixes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&quot;This control does not allow connection strings with the following keywords: `Integrated Security&#039;, `Trusted_Connection&#039;&quot;</title>
		<link>http://vspug.com/dez/2007/08/06/quot-this-control-does-not-allow-connection-strings-with-the-following-keywords-integrated-security-trusted-connection-quot/</link>
		<comments>http://vspug.com/dez/2007/08/06/quot-this-control-does-not-allow-connection-strings-with-the-following-keywords-integrated-security-trusted-connection-quot/#comments</comments>
		<pubDate>Mon, 06 Aug 2007 19:04:00 +0000</pubDate>
		<dc:creator>Dessie Lunsford</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[I ran across an interesting situation recently with an application I have running on one of my WSS 3.0 boxes that performs a backup of our MCMS site.&#160; It had been a few months since I had a need to run the app, but when I attempted it this time I came across the following [...]]]></description>
			<content:encoded><![CDATA[<p>I ran across an interesting situation recently with an application I have running on one of my WSS 3.0 boxes that performs a backup of our MCMS site.&nbsp; It had been a few months since I had a need to run the app, but when I attempted it this time I came across the following error:</p>
<p><span style="FONT-SIZE:18pt;COLOR:red;FONT-FAMILY:Verdana;">This control does not allow connection strings with the following keywords: `Integrated Security&#39;, `Trusted_Connection&#39;</span></p>
<p><span style="FONT-SIZE:18pt;COLOR:red;FONT-FAMILY:Verdana;"></span>&quot;Ok&quot;, I thought&#8230;this is strange.&nbsp; Up until then, the application had been running just fine with no errors.&nbsp; We use &quot;mixed&quot; authentication on our SQL boxes (standard practice), so this error didn&#39;t really make sense to me since I&#39;ve been using &quot;Integrated Security&quot; on it the entire time and have never had any problems.&nbsp; </p>
<p>After Googling this (with very little success I might add), I came across a few solutions that lead me to a work-around.&nbsp; It turns out that when installing Windows SharePoint Services 3.0 on the server, the web.config on the default site (where WSS was installed and where the web app was running) gets modified to include multiple lines of configuration settings to help get WSS running.&nbsp; No big deal&#8230;I knew this already, but apparently this can mess with how (some, not all) web applications connect to SQL by limits set on security (which are defined in the &quot;Security Policy&quot;, and &quot;Trust Level&quot; sections of the web.config).</p>
<p>In an attempt to fix this error, I ran through each of the possible options for making a connection to SQL (including passing the username and password as clear text &#8211; bad bad bad!!)&#8230;the only option that seemed to work was to use SQL authentication instead of windows authentication.&nbsp; This, of course, was not going to work for us since it&#39;s always our practice to use windows authentication for security and compatibility with all of our web applications.</p>
<p>I then tried removing WSS from the box (it&#39;s just a dev box to no big issue there), and removing all references in the default site web.config to SharePoint&#8230;but still no success.</p>
<p>I then tried creating a new Website in IIS (using a separate port 8080) and copied the app to this.&nbsp; </p>
<p><span style="FONT-SIZE:14pt;FONT-FAMILY:Verdana;">Lo and behold &#8211; the web app now worked!!</span>&nbsp; </p>
<p>So, even though I basically had reset the web.config back to its original state prior to the installation of WSS (or at least to where I thought it should be), there may still have been something possibly in the IIS Meta data that was screwing with the web app (my guess anyways).</p>
<p>Why none of the other numerous web applications (that all have similar SQL connections by the way) running on the box didn&#39;t fail&#8230;I have no clue.&nbsp; But in my case, the fix apparently seemed to be to simply move the web application to a different site to make it work.&nbsp; My next step will probably be to redo IIS on the dev box and see if I can fix whatever&#39;s wrong, but for now I can at least access the web app in question with a port:8080 workaround.</p>
<p>For reference, here&#39;s a few links to some of the sites that lead me to this fix:<br /></font><a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1918708&amp;SiteID=1"><font>http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1918708&amp;SiteID=1</font></a><br /><a href="http://www.eggheadcafe.com/software/aspnet/30460993/this-control-does-not-all.aspx"><font>http://www.eggheadcafe.com/software/aspnet/30460993/this-control-does-not-all.aspx</font></a><br /><a href="http://robotmindsofrobotslaves.net/?p=39"><font>http://robotmindsofrobotslaves.net/?p=39</font></a> </p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/dez/2007/08/06/quot-this-control-does-not-allow-connection-strings-with-the-following-keywords-integrated-security-trusted-connection-quot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Sites From Templates</title>
		<link>http://vspug.com/dez/2007/07/10/creating-sites-from-templates/</link>
		<comments>http://vspug.com/dez/2007/07/10/creating-sites-from-templates/#comments</comments>
		<pubDate>Tue, 10 Jul 2007 15:27:00 +0000</pubDate>
		<dc:creator>Dessie Lunsford</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[Since this is my first post, I decided that the easiest way to get things rolling was to list out some of the basic information concerning the templates available in WSS 3.0, including the &#34;fabulous 40&#34;.
I believe that with the inclusion of the optionally available &#34;GroupBoard Workspace&#34; template, the total list of available templates reaches [...]]]></description>
			<content:encoded><![CDATA[<p>Since this is my first post, I decided that the easiest way to get things rolling was to list out some of the basic information concerning the templates available in WSS 3.0, including the &quot;fabulous 40&quot;.</p>
<p>I believe that with the inclusion of the optionally available &quot;GroupBoard Workspace&quot; template, the total list of available templates reaches around 51&#8230;and granted, most of the following&nbsp;information can be found on any one of numerous other posts and forums, but my goal here is to simply provide a reference of descriptions for the templates that may provide some usefullness when deciding which ones to install and use as the base for building your site(s).</p>
<p>All the &quot;40&quot; templates can be downloaded <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5807b5ef-57a1-47cb-8666-78c1363f127d&amp;DisplayLang=en" target="_blank">here</a>, and the &quot;GroupBoard Workspace&quot; template&nbsp;can be downloaded <a href="http://www.microsoft.com/downloads/details.aspx?familyid=4030D847-31BC-43EA-90EC-111B546D5411&amp;displaylang=en" target="_blank">here</a>.<br />For a preview of each of the templates, you can download some sample screenshots created by Todd Baginski <a href="/files/folders/tbaginski/entry2530.aspx" target="_blank">here</a>, or view some sample sites <a href="http://demo.sharepointteamservices.net/default.aspx" target="_blank">here</a>.</p>
<div class="ExternalClass41BE98F91317466D9A3C626058C80827">
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>In <strong>Windows SharePoint Services</strong>, each of the sites you will be creating, sharing and accessing will all be created from one of a variety of templates.&nbsp; Each of these templates gives you a default layout and content that is designed to assist you in the target goal of your site.</div>
<div>&nbsp;</div>
<div>Below, is a listing of all the available templates along with a brief description of its purpose.</div>
<div>&nbsp;</div>
<div><font size="4">Site Template Descriptions:</font></div>
<div>&nbsp;</div>
<div>**********************************************************<br /><font>Standard (default)&nbsp;Templates</font><br />**********************************************************</div>
<div>The <strong><u>Team Site template</u></strong> creates a site for teams to create, organize, and share information quickly and easily. It includes a Document Library, and basic lists such as Announcements, Events, Contacts, and Quick Links.</div>
<div>A <strong><u>Blank Site template</u></strong> allows you to customize all lists and libraries to meet the needs of your specific requirements.</div>
<div>The <strong><u>Document Workspace template</u></strong> is designed for users to work together on a document. It provides a document library for storing the primary document and supporting files, a tasks list for assigning to-do items, and a links list for resources related to the document.</div>
<div>A <strong><u>Wiki</u></strong> is a new site template in Windows SharePoint Services 3.0 that makes it easy to create, edit, link, and restore an individual Web page. Wikis can be used as creative forums to brainstorm ideas, manage knowledge bases, create designs as well as instruction guides or simply gather information in an easy-to-edit format. Wikis are easy to create, modify, and annotate in addition to tracking contributions and changes.<br />*(A very popular and currently the largest Wiki site on the Web, is Wikipedia.org&nbsp;- click the link (<a href="http://en.wikipedia.org/wiki/Main_Page">Wikipedia.org</a>)&nbsp;to see what the possibilities of a Wiki site could be)<br />&nbsp;</div>
<div>A <strong><u>Blog template</u></strong> allows the creation of a site that enables you or your organization to quickly share ideas and information. Blogs contain posts that are dated and listed in reverse chronological order. People can comment on your posts, as well as provide links to interesting sites, photos, and related blogs.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>**********************************************************<br /><font>Meeting Workspace Templates</font><br />**********************************************************</div>
<div>A <strong><u>Meeting Workspace</u></strong> site provides a place where your meeting attendees can go for the most up-to-date information about the meeting, whether you are managing a year-long project with recurring meetings or planning a small event.</div>
<div>Feature of meeting workspaces include page tabs (accross top of page), objectives, attendees lists, document libraries, etc.</div>
<div>&nbsp;</div>
<div>There are 5 templates available for creating meeting workspaces:</div>
<div>&nbsp;</div>
<div><strong><em><u>Basic Meeting Workspace</u></em></strong>&nbsp; This template is designed to plan, organize, and track your meeting. This template includes Objectives, Attendees, Agenda, and Document Library.</div>
<div>&nbsp;</div>
<div><strong><em><u>Blank Meeting Workspace</u></em></strong>&nbsp; This template creates a blank Meeting Workspace site for you to customize, based on your requirements.</div>
<div>&nbsp;</div>
<div><strong><em><u>Decision Meeting Workspace</u></em></strong>&nbsp; This template is designed for reviewing documents and recording any decisions that are reached at the meeting. The template includes Objectives, Attendees, Agenda, Document Library, Tasks, and Decisions.</div>
<div>&nbsp;</div>
<div><strong><em><u>Social Meeting Workspace</u></em></strong>&nbsp; This template helps you to plan social occasions, such as a company picnic or a party for your club. You can give it a serious look, or have fun and make it flashy. This template includes Attendees, Directions, Image/Logo, Things To Bring, Discussions, and Photos (Picture Library).</div>
<div>&nbsp;</div>
<div><strong><em><u>Multipage Meeting Workspace</u></em></strong>&nbsp; This template provides the basics to plan, organize, and track your meeting with multiple pages. It includes Objectives, Attendees, and Agenda. It also includes two blank pages for you to customize, based on your requirements.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>**********************************************************<br /><font>Additional Templates</font><br />**********************************************************</div>
<div>The <strong><u>Board of Directors</u></strong> application template provides a single location for an external group of members to store and locate common documents such as quarterly reviews, shareholder meeting notes and annual strategy documents. The template also tracks tasks, issues and calendar items so board members have a single location to view information relevant to them.</div>
<div>The <strong><u>Business Performance Reporting</u></strong> application template helps organization managers track the satisfaction of customers through a combination of surveys and discussions. Surveys can be sent via Office InfoPath 2007 which are then consolidated by the template to give an overall response to a series of questions.</div>
<div>The <strong><u>Case Management for Government Agencies</u></strong> application template helps case managers track the status and tasks required to complete their work. When a case is created, standard tasks and documents are created which are modified based on the work each case manager has completed.</div>
<div>The <strong><u>Classroom Management</u></strong> application template helps instructors and students organize and store information related to a particular class. The site includes document libraries to store assignments and lecture notes as well as calendars and announcement capability to enable communication from instructor to students.</div>
<div>The <strong><u>Clinical Trial Initiation and Management</u></strong> application template helps teams manage the process of tracking clinical trial protocols, objective setting, subject selection and budget activities. The site provides useful Officer Wordr 2007 templates as well as the capability to create, track and </div>
<div>assign tasks and issues related to a particular clinical trial.</div>
<div>The <strong><u>Competitive Analysis</u></strong> Site application template helps teams organize information about competitors and their products. The site provides useful Microsoft Office 2007 documents to perform SWOT and other useful competitive analysis techniques. Links to industry, company and product news can also be included to provide a single location for all competitive information.</div>
<div>The <strong><u>Discussion Database</u></strong> application template provides a location where team members can create and reply to discussion topics. Discussions are organized by categories, which are created by a site manager, and can be linked to Office Outlook 2007 via an RSS feed.</div>
<div>The <strong><u>Disputed Invoice Management</u></strong> application template helps accounts payable departments track open invoices including the potential savings associated with paying the invoice early. The site includes useful templates for analyzing the reasons invoices are being disputed as well as tracking who to contact for more information.</div>
<div>The <strong><u>Employee Activities</u></strong> Site application template helps manage the creation and attendance of events for employees. Activity owners use the site to review proposals for new activities and create event calendar items. Employees use the site to sign up as well as track which activities they&#39;ve attended in the past.</div>
<div>The <strong><u>Employee Self-Service Benefits Application</u></strong> template provides tools for an organization to inform employees about available benefits as well as enabling them to enroll for each benefit.</div>
<div>The <strong><u>Employee Training Scheduling and Materials</u></strong> application template helps instructors and employees manage courses and related materials. Instructors can use the site to add new courses and organize course materials. Employees use the site to schedule attendance at a course, track courses they&#39;ve attended and to provide feedback.</div>
<div>The <strong><u>Equity Research</u></strong> application template helps teams collaborate on researching stocks and other equities. It provides a central location for teams to store documents, post links, track news, and hold discussions related to the equities tracked by the site.</div>
<div>The <strong><u>Integrated Marketing Campaign Tracking</u></strong> application template helps marketing managers track the implementation and success of outbound marketing activities. The template allows a manager to create marketing activities and track the results of those activities, such as responses generated and sales completed. The template contains multiple methods of analyzing the success of the campaigns including automated calculations and Office Excel 2007 templates for more detailed analyses.</div>
<div>The <strong><u>Manufacturing Process Management</u></strong> application template helps teams to model and track manufacturing processes as well as tasks and issues that arise in the upkeep of these processes.</div>
<div>The <strong><u>New Store Opening</u></strong> application template helps a team manage the opening of new store locations or re-modeling of existing store location. The site provides a single location to manage tasks, issues, and documents for all store opening processes, enabling end users to view relevant information and providing project managers insight across the entire project.</div>
<div>The <strong><u>Product and Marketing Requirements Planning</u></strong> application template enables teams to manage the process of collecting and documenting requirements for new products. The site provides several Microsoft Office 2007 templates providing useful techniques for Marketing, Product and Steering committee actions as well as a template for meeting notes and financial information.</div>
<div>The <strong><u>Request for Proposal</u></strong> application template helps manage the process of creating and releasing an initial RFP, collecting submissions of proposals and formally accepting the selected proposal from amongst those submitted. The site also helps simplify the process of notifying individuals about the status of the RFP and submitted proposals.</div>
<div>The <strong><u>Sports League</u></strong> application template helps an intra-company league administrator manage a baseball league. The site tracks team information, players, captains and scheduled team activities such as games, practices and social events. Team members can enter in game results and perform analysis at a team, game or individual player level. The site also enables discussions between league members through a League Discussion board.</div>
<div>The <strong><u>Team Work Site</u></strong> application template provides a place where project teams can upload background documents, track scheduled calendar events and submit action items that result from team meetings. The site also tracks the creation and purpose of `sub-teams&#39; as well as enables discussion of topics created by members of the team.</div>
<div>The <strong><u>Timecard Management</u></strong> application template helps teams track hours spent working on various projects. The site enables team members to &#39;punch in&#39; on a particular project and &#39;punch out&#39; when they cease work. The system automatically generates the time worked by project, and can show managers who is working on a particular project, total hours versus budgeted time and the details of who worked on a each project entered into the site.</div>
<div>The <strong><u>Absence Request and Vacation Schedule Management</u></strong> application template helps employees manage requests for out of office days. Team members post days they will be unavailable and can use the system to assign their responsibilities to others during those days. The application template helps team leaders manage requests for vacation and provides dashboards showing which users are signed up for a set of responsibilities.</div>
<div>The <strong><u>Budgeting and Tracking Multiple Projects</u></strong> application template helps project teams track and budget multiple, interrelated sets of activities. The template provides project management tools such as project creation, assignment of new tasks, Gantt Charts and common status designators. It helps team members consolidate the status of multiple projects into a single view, tracking progress against a set project budget and timeline.</div>
<div>The <strong><u>Bug Database</u></strong> application template helps development teams collect and track information about bugs in their code. The template allows bugs to be logged with information such as reproduction steps, category, comments, priority, and severity of the bug. Bug categories can specify category owners so users can quickly determine the appropriate bug owners.</div>
<div>The <strong><u>Call Center</u></strong> application template helps teams manage the process of handling customer service requests. The application template helps teams manage service requests from issue identification to cause analysis and resolution. Role-based dashboards display relevant information for each service request and a knowledge base can help track related documents and items previously used to solve past call center issues. Management focused dashboards track performance with metrics such as average resolution time and service request performance history.</div>
<div>The <strong><u>Change Request Management</u></strong> application template helps users track risks associated with a design change. Team members can submit a change request, notifying stakeholders of the risks involved with the change. The application template allows a team member to approve or reject the request.</div>
<div>The <strong><u>Compliance Process Support Site</u></strong> application template helps both teams and executive sponsors to manage compliance implementation endeavors. The site allows users to specify control tasks required to meet regulation requirements as well capture compliance issues as they arise. The application template contains document libraries used by team members to store related files as well as a calendar to track key audit dates.</div>
<div>The <strong><u>Contacts Management</u></strong> application template helps teams manage contact information that needs to be shared among team members. The application template allows teams to enter contact information through a Web-based interface or through Microsoft Office Outlook 2007. When used in conjunction with Office Outlook 2007, team members can &#39;subscribe&#39; to receive updated contract information whenever other users make changes to a contact.</div>
<div>The <strong><u>Document Library and Review</u></strong> application template helps people manage the review cycle common to processes like new product specification, publication, knowledge management, and project plan development. It combines the functionality of a version-tracking document library with a threaded discussion list to provide a feedback and revision system. This template is intended for teams that need a central location for document review, discussion, revision control, and approval.</div>
<div>The <strong><u>Event Planning</u></strong> application template helps teams organize events efficiently through the use of online registration, schedules, communication, and feedback. Role-based dashboards offer specific information for various event members such as speaker, guest, staff, vendor, delegate, and attendee home pages.</div>
<div>The <strong><u>Expense Reimbursement and Approval</u></strong> application template helps manage elements of the expense approval process, saving time for approvers. Employees can enter expense information into the application template. Approvers can then review the information and manage the payment approval. Users monitor the status of their reimbursement request through a filtered view listing their outstanding requests.</div>
<div>The <strong><u>Help Desk</u></strong> application template helps teams manage the process of handling service requests. Team members use the application template to identify a service request, manage identification of the root cause, and track solution status. The application template provides role-based dashboards displaying information relevant to customer service representatives and managers, including performance history.</div>
<div>The <strong><u>Inventory Tracking</u></strong> application template helps organizations track elements associated with inventory. The application template helps managers track inventory levels by capturing manual input of updated inventory information. Users are notified when each part reaches the reorder quantity and helps these users manage customer and supplier information such as historical inventory levels.</div>
<div>The <strong><u>IT Team Workspace</u></strong> application template helps teams manage the development, deployment, and support of software projects. The application template allows users to update information on projects, tasks, issues, milestones, and bugs. It also includes help desk functionality, making it </div>
<div>easy for team members to guide service requests from initiation to resolution. Role based dashboards provide relevant information to team members, such as unassigned tasks and performance history.</div>
<div>The <strong><u>Job Requisition and Interview Management</u></strong> application template demonstrates the power of collaboration by helping a recruiter streamline the process of filling job openings within a company. The template helps the recruiter manage requisitions, capture referrals and resumes and coordinate interviews. The application template enables people to input their candidate feedback centrally and track hire / no hire recommendations.</div>
<div>The <strong><u>Knowledge Base</u></strong> application template helps teams manage the information that is resident within their organization. The template enables team members to upload existing documents or create new ones using Web-based content creation tools. Items are tagged with relevant identifying information so that others can more easily find the documents and learn from the collective knowledge in their </div>
<div>organization. The template can be utilized in a &#39;top down&#39; approach, where a centralized knowledge department &#39;pushes down&#39; relevant content to the rest of the business or a &#39;bottom up&#39; approach, where knowledge is captured and shared by all users as a normal part of doing business.</div>
<div>The <strong><u>Lending Library</u></strong> application template helps people manage the physical assets in an organization&#39;s library. The application template tracks general properties about the physical assets and which user has currently checked out the asset. It also provides a librarian dashboard to help identify </div>
<div>currently available and overdue assets. Automated e-mail notifications can be sent to borrowers who have an overdue item.</div>
<div>The <strong><u>Physical Asset Tracking and Management</u></strong> application template helps teams manage requests and tracking of physical assets. An asset manager approves asset requests and manages the properties of the assets in the system, such as location, condition, manufacturer, model, current owner, and estimated value.</div>
<div>The <strong><u>Project Tracking Workspace</u></strong> application template helps small team projects manage project information in a single location. The application template provides a place where a team can list and view project issues and tasks. Functionality is provided to help drive project status reporting, including assignment of new tasks, Gantt Charts, and common status designators.</div>
<div>The <strong><u>Room and Equipment Reservations</u></strong> application template helps teams manage the utilization of shared meeting rooms and equipment. The application template enables team members to identify times when specific rooms and/or equipment are available and place a reservation for a specified time.</div>
<div>The <strong><u>Sales Lead Pipeline</u></strong> application template helps teams manage the sales pipeline by tracking leads, opportunities, contacts, and accounts. Through role-based dashboards, team members can track sales information, assign open opportunities and gain visibility into the status of overall leads entered into the application template.</div>
<div>&nbsp;</div>
<div>The <strong><u>GroupBoard Workspace 2007</u></strong> template creates a space for a group or team to connect and share information in a collaborative environment, improving team efficiency and productivity. The template helps track team member whereabouts and status, and includes a built-in timecard list and organization chart. Meetings can be scheduled with attendees, and meeting rooms and other resources can be reserved. It also enables members to share phone messages and circulate memos.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/dez/2007/07/10/creating-sites-from-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
