<?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>lightyeardesign.com &#187; Thantos</title>
	<atom:link href="http://lightyeardesign.com/author/Thantos/feed/" rel="self" type="application/rss+xml" />
	<link>http://lightyeardesign.com</link>
	<description>Design.  Develop.  Defy.</description>
	<lastBuildDate>Wed, 29 Jun 2011 19:03:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>ExpressionEngine: display a navigation menu if an entry is assigned a specific category.</title>
		<link>http://lightyeardesign.com/2011/06/expressionengine-dynamically-display-navigation-menu-if-an-entry-is-assigned-a-certain-category/</link>
		<comments>http://lightyeardesign.com/2011/06/expressionengine-dynamically-display-navigation-menu-if-an-entry-is-assigned-a-certain-category/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 19:00:48 +0000</pubDate>
		<dc:creator>Thantos</dc:creator>
				<category><![CDATA[ExpressionEngine]]></category>

		<guid isPermaLink="false">http://lightyeardesign.com/?p=124</guid>
		<description><![CDATA[As an avid ExpressionEngine user, I like to dynamically generate as much as I can. This also includes the dynamic generation of navigation menus, naturally. However, there are times when I will use an entry as a static navigation menu by assigned it a specific URL TITLE (for example: whats_new or righthand_menu). Now, in the [...]]]></description>
			<content:encoded><![CDATA[<p>As an avid ExpressionEngine user, I like to dynamically generate as much as I can.  This also includes the dynamic generation of navigation menus, naturally.  However, there are times when I will use an entry as a static navigation menu by assigned it a specific URL TITLE (for example: whats_new or righthand_menu).  Now, in the case of categories, how does one display this right-hand menu <strong>ONLY</strong> on entries of a weblog that are assigned a specific category?  Here is how:<br />
<code><br />
        {!--Display right-hand menu ONLY if the entry has been assigned to the AUTOMOBILES category--}<br />
        {exp:query sql="select count(w.url_title) AS post_count from exp_weblog_titles w, exp_category_posts cp, exp_categories c where w.entry_id = cp.entry_id and cp.cat_id = c.cat_id and c.cat_url_title='automobiles_category' and w.url_title = '{segment_3}' limit 1"}<br />
        <?php $assignedCatVar = "{post_count}";?></p>
<p>        {/exp:query}<br />
        <?php if ($assignedCatVar == "1") { ?><br />
            {!-- Display AUTOMOBILES right-hand menu --}</p>
<div class="contents03">
                        {exp:query sql="SELECT e1.title, e1.entry_date, e1.edit_date, e2.field_id_2 FROM exp_weblog_titles e1, exp_weblog_data e2 WHERE e1.entry_id = e2.entry_id and e2.weblog_id = 51 and e1.url_title = 'righthand_menu' LIMIT 1"}<br />
                            {field_id_2}<br />
                        {/exp:query}
                    </div>
<p>        <?php } ?></code></p>
<p>So, what exactly does this do?<br />
The first query retrieves the post count of any entries (in this case, the URL TITLE of the entry is in the third segment of the URL) that are assigned to a specific category (we are looking for 1 here; in fact, the LIMIT 1 line keeps the query from searching for anything greater, as our relevant choices are either 1 or 0).  The count is then applied to a PHP variable called <em>assignedCatVar</em>.</p>
<p>If the assignedCatVar is = 1, then the next query grabs the contents of the<em> right-hand menu</em> entry and displays it appropriately on the page.  </p>
<p>Simple and effective.</p>
]]></content:encoded>
			<wfw:commentRss>http://lightyeardesign.com/2011/06/expressionengine-dynamically-display-navigation-menu-if-an-entry-is-assigned-a-certain-category/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ExpressionEngine search results:  custom template paths for section URLs with categories</title>
		<link>http://lightyeardesign.com/2011/02/expressionengine-search-results-custom-template-paths-for-section-urls-with-categories/</link>
		<comments>http://lightyeardesign.com/2011/02/expressionengine-search-results-custom-template-paths-for-section-urls-with-categories/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 23:12:01 +0000</pubDate>
		<dc:creator>Thantos</dc:creator>
				<category><![CDATA[ExpressionEngine]]></category>

		<guid isPermaLink="false">http://lightyeardesign.com/?p=113</guid>
		<description><![CDATA[We use ExpressionEngine on a number of supported sites, and I tend to use ExpressionEngine&#8217;s (EE) internal search mechanism whenever feasible. The search results are generated from path setting specified at Admin › Weblog Administration › Weblog Management › Edit Weblog Preferences› Path Settings › Search Results URL . For example, setting the Search Results [...]]]></description>
			<content:encoded><![CDATA[<p>We use ExpressionEngine on a number of supported sites, and I tend to use ExpressionEngine&#8217;s (EE) internal search mechanism whenever feasible.  The search results are generated from path setting specified at Admin  ›  Weblog Administration  › Weblog Management  ›  Edit Weblog Preferences›  Path Settings ›  Search Results URL .</p>
<p>For example, setting the <strong>Search Results URL</strong> value to<br />
<code>{homepage}staff-members</code> will create a SEARCH RESULT of <em>http://mysite.com/staff-members/</em>.</p>
<p>Easy enough, right?</p>
<p>Now, what do you do when you have a Weblog that contains category-based information.  The specified <em>Search Results URL</em> does not take this information into account.  So, if you have a weblog with a hard-coded path of <em>http://mysite.com/staff-members/category1/johndoe</em> ,  how do you get the category to show up in the search results?</p>
<p>I have a workaround on the RESULTS template in my SEARCH template group:</p>
<blockquote><p>{exp:search:search_results}</p>
<p>&lt;?php $autoPath = &#8216;{auto_path}&#8217;;</p>
<p>$lastSegment = basename($autoPath);</p>
<p>//Staff-member URL update, based on the category assigned to the entry</p>
<p>if(strpos($autoPath, &#8216;staff-members&#8217;)){</p>
<p>//variable to assign the category to the appropriate URL segment for the Rule</p>
<p>$catVar = 1;</p>
<p>$basename = &#8216;catPath&#8217;;</p>
<p>?&gt;</p>
<p>{categories}</p>
<p>&lt;?php</p>
<p>$tempname = $basename.$catVar;</p>
<p>$$tempname = &#8220;{category_url_title}&#8221;;</p>
<p>$catVar++;</p>
<p>?&gt;</p>
<p>{/categories}</p>
<p>&lt;?php $autoPath = &#8220;{homepage}&#8221;.&#8221;staff-members/$catPath1/$lastSegment&#8221;;</p>
<p>} ?&gt;</p>
<p>&lt;br /&gt;&lt;span&gt;&lt;?php echo $autoPath; ?&gt;&lt;/span&gt;</p>
<p>&lt;/div&gt;</p>
<p>{/exp:search:search_results}</p></blockquote>
<p>So, if the <strong>staff-members</strong> URL segment exists in the specified URL&#8217;s path, the Category/Categories assigned to the Entry are obtained and then added to the URL, defined by the $autoPath variable.</p>
<p>It might not be the most elegant solution, but it works great for us.</p>
]]></content:encoded>
			<wfw:commentRss>http://lightyeardesign.com/2011/02/expressionengine-search-results-custom-template-paths-for-section-urls-with-categories/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Library Not Registered Javascript error with SharePoint and Internet Explorer 8</title>
		<link>http://lightyeardesign.com/2011/01/library-not-registered-javascript-error-with-sharepoint-and-internet-explorer-8/</link>
		<comments>http://lightyeardesign.com/2011/01/library-not-registered-javascript-error-with-sharepoint-and-internet-explorer-8/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 16:33:45 +0000</pubDate>
		<dc:creator>Thantos</dc:creator>
				<category><![CDATA[Office 2007]]></category>

		<guid isPermaLink="false">http://lightyeardesign.com/?p=109</guid>
		<description><![CDATA[We use SharePoint 3.0 for quite a bit of document collaboration. Unfortunately, when using Internet Explorer 8, an error is thrown when we attempted to upload multiple documents within SharePoint. The error details mention Library Not Registered. Luckily, there is an easy fix: Open up any MS Office 2007 product. In my instance, I used [...]]]></description>
			<content:encoded><![CDATA[<p>We use SharePoint 3.0 for quite a bit of document collaboration.  Unfortunately, when using Internet Explorer 8, an error is thrown when we attempted to upload multiple documents within SharePoint.  The error details mention <em>Library Not Registered</em>. </p>
<p>Luckily, there is an easy fix:</p>
<ul>
<li>Open up any MS Office 2007 product.  In my instance, I used Office 2007.</li>
<li>Go to Help>Office Diagnostics.</li>
<li>Run diagnostics.  This took about 5 minutes to complete.</li>
<li>Return to your SharePoint site. the multiple document upload tool should now be working.  Apparently, this fix re-registered any .DLLs that were causing the error.  I love easy fixes!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lightyeardesign.com/2011/01/library-not-registered-javascript-error-with-sharepoint-and-internet-explorer-8/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>LDAP and PHP login script</title>
		<link>http://lightyeardesign.com/2009/06/ldap-and-php-login-script/</link>
		<comments>http://lightyeardesign.com/2009/06/ldap-and-php-login-script/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 20:03:41 +0000</pubDate>
		<dc:creator>Thantos</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://lightyeardesign.com/?p=53</guid>
		<description><![CDATA[Authenticating users of your web applications can be tedious, especially when your users are expected to remember multiple passwords (which can become a security vulnerability in it&#8217;s own right). That being said, integrating your login scripts with Active Directory/LDAP can be beneficial for a variety reasons: stronger passwords, fewer login credentials for your user to [...]]]></description>
			<content:encoded><![CDATA[<p>Authenticating users of your web applications can be tedious, especially when your users are expected to remember multiple passwords (which can become a security vulnerability in it&#8217;s own right).  That being said, integrating your login scripts with Active Directory/LDAP can be beneficial for a variety reasons: stronger passwords, fewer login credentials for your user to remember, and fewer headaches for you.   Here is how we integrated LDAP with our online application authentication.</p>
<p>LDAP (short for Lightweight Directory Access Protocol), a directory service that runs over TCP/IP, stores information.  The storage is similar to how a database stores information, but the structure is ideal for attribute-based, hierarchical structured data that does not undergo frequent changes (for example, the employees&#8217;s name, Active Directory group membership, address, and so forth).  The LDAP directory can be thought of as a tree of nodes, where each node represents an entry in the LDAP database.  These entries are comprised of a collection of attribute-value pairs, and they are identified uniquely by a &#8216;distinguished name&#8217; or DN.  The DN is important, because this is what we will be using to determine a user&#8217;s group membership.<br />
Our login script will</p>
<ol>
<li>First bind to our LDAP server with a resource account (we are not using anonymous binding, so we will need to provide a resource account&#8217;s credentials)</li>
<li>Check that the user&#8217;s ID and password are legit and exist in our Active Directory environment</li>
<li>Check if the user is a member of a particular security group
</ol>
<p>If all of these conditions are met, the users will have successfully logged on and will be granted access to our application.</p>
<p>We will store our authentication function in a php file entitled <strong>resourceBind.php</strong>.  The entire contents of resourceBind.php:<br />
[php]<strong>&lt;?php</p>
<p>function UMldap($Username, $SSO_Password){<br />
//*************************************<br />
///////////////////////////////// Using ldap bind<br />
$ldaprdn  = &#8216;bindaccountname&#8217;;    // ldap rdn or dn<br />
$ldappass = &#8216;bindaccountpassword&#8217;;  // associated password<br />
$ldapserver = &#8216;ldaps://your.ldap.server:3269&#8242;;</p>
<p>//This is the Active Directory group that users MUST be a member of in order to login successfully<br />
$groupPath1 = &quot;CN=YOURSECURITYGROUP-GS,OU=Accounting,OU=Lewis-Building,OU=Headquarters,DC=headquarters,DC=acme,DC=com&quot;;</p>
<p>/////////////////////////////Base DN<br />
$ldap_base_dn = &quot;CN=Users,DC=headquarters,DC=acme,DC=com&quot;;</p>
<p>  $ldapconn = ldap_connect($ldapserver)or die(&quot;Could not connect to LDAP server.&quot;);</p>
<p>	if ($ldapconn) {   //connect to ldap server<br />
            // binding to ldap server<br />
        $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);<br />
        // verify binding<br />
        if ($ldapbind) {<br />
           // echo &quot;LDAP bind successful&#8230;&quot;;<br />
			$errorCount = 0;</p>
<p>			$ld_filter = &quot;samaccountname=&quot; . $Username;<br />
			$ldap_base_dn = &quot;DC=com&quot;;<br />
                        //Recursively search for the account name in the directory tree.  Slow, but effective&#8230;<br />
			$result = ldap_search($ldapconn, $ldap_base_dn, $ld_filter);</p>
<p>       //Create result set<br />
       $entries = ldap_get_entries($ldapconn, $result);</p>
<p>      //If the account exists, attempt a bind with it.  This will ensure that the provided password is legit</p>
<p>      $bind = @ldap_bind($ldapconn, $entries[0][dn], $SSO_Password);<br />
if( !$bind || !isset($bind))<br />
{<br />
     //the bind failed, which means that the user could have typed in the wrong ID or password.  We will display another login form<br />
?&gt;</p>
<p>     &lt;form action=&quot;&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;&quot; method=&quot;POST&quot; id=&quot;login&quot; name=&quot;login&quot;&gt;<br />
     Username: &lt;input type=text size=30 name=&quot;ssoname&quot; maxlength=30 /&gt;&lt;br /&gt;<br />
     Password: &lt;input type=password size=30 name=&quot;ssopass&quot; maxlength=30 /&gt;&lt;br /&gt;<br />
     &lt;button type=&quot;submit&quot; value=&quot;submit&quot; name=&quot;submit&quot; &gt;Logon&lt;/button&gt;<br />
     &lt;/form&gt;<br />
&lt;?php<br />
   //no point in running the rest of the function, so exit out.<br />
    exit;</p>
<p>} </p>
<p>	       $ii=0;<br />
	       for ($i=0; $ii &lt; $entries[$i][&quot;count&quot;]; $ii++)<br />
	       {</p>
<p>	          $data = $entries[$i][$ii];</p>
<p>	          if ($data == &quot;memberof&quot;) {</p>
<p>                        $total_memberof = count($entries[$i][$data]);</p>
<p>			  	$jj=0;<br />
			        for ($jj=0; $jj&lt;$total_memberof; $jj++) {</p>
<p>			        //Check the groups that the user is a member of and see if our specific group is in the list<br />
			                if ($entries[$i][$data][$jj] == $groupPath1)<br />
			                {<br />
                                               // The  user is a member of the group, so lets create a session and then return true<br />
						$_SESSION['USERGROUP'] = $entries[$i][$data][$jj];<br />
						return true;<br />
						break;</p>
<p>			                }<br />
                   }//end for<br />
            }//end if<br />
        }//end for<br />
        } else { //could not bind, so display an error message and the login form<br />
                // We could not bind with our default resource account, so let&#8217;s exit and not waste any time with the users credentials<br />
		$displayForm=true;<br />
        }</p>
<p>	}///close connect IF<br />
 //Unbind from our resource account<br />
  ldap_unbind($ldapconn);</p>
<p>//*************************************</p>
<p>}//end function</p>
<p>?&gt;</strong><br />
[/php]</p>
<p>And, our login page, which we will call <strong>login.php</strong>, and which will be located in the same directory as resourceBind.php:<br />
[php]&lt;?php<br />
//Disable error messages<br />
    error_reporting(0);<br />
?&gt;<br />
&lt;?php require_once(&#8216;resourceBind.php&#8217;); ?&gt;<br />
&lt;?php<br />
if ($_POST) {</p>
<p>//Handy function to remove specific special characters from user provided input.  ALWAYS validate user input.  In this case, we are removing characters that are not allowed in usernames and passwords.<br />
     function cleanTxt($text)<br />
     {<br />
     	     $code_entities_match = </p>
<p>array(&#8216;&#8211;&#8217;,'&gt;&#8217;,'&amp;quot;&#8217;,'!&#8217;,'#&#8217;,'$&#8217;,'%&#8217;,'^&#8217;,'&amp;&#8217;,'*&#8217;,'(&#8216;,&#8217;)',&#8217;{&#8216;,&#8217;}',&#8217;|',&#8217;:',&#8217;&quot;&#8217;,'&lt;&#8217;,&#8217;[',']&#8216;,&#8217;\\&#8217;,';&#8217;,&quot;&#8217;&quot;,&#8217;,',&#8217;/',&#8217;*',&#8217;~',&#8217;`');<br />
     	     $code_entities_replace = array(&#8216;-&#8217;,'-&#8217;,&#8221;,&#8221;,&#8221;,&#8221;,&#8221;,&#8221;,&#8221;,&#8221;,&#8221;,&#8221;,&#8221;,&#8221;,&#8221;,&#8221;,&#8221;,&#8221;,&#8221;);<br />
     	     $text = str_replace($code_entities_match, $code_entities_replace, $text);<br />
     	     return $text;<br />
     }<br />
  //Set form variables<br />
 $Username=stripslashes(cleanTxt($_POST['ssoname']));<br />
 $SSO_Password=stripslashes($_POST['ssopass']);</p>
<p>//Get Ip Address and User Agent information.   This is useful info to store in sessions, or a database table, especially if you need to track timestamps and access<br />
  $userIP = $_SERVER['REMOTE_ADDR'];<br />
//Get Timestamp<br />
  $myDate = date(&quot;Y-m-d H:i:s&quot;);//Date in easy-to-read format</p>
<p>$displayForm=false;</p>
<p>        if(UMldap($Username,$SSO_Password)){<br />
           //set complex string in case there is no &#8216;whencreated&#8217; field for the username</p>
<p>		//User has valid credentials.  We are creating a new session variable with the user name.  This is also a good place to effectively double up your authentication security by checking to see if the user name exists in another medium, such as a MySQL or Oracle table.<br />
                   $_SESSION['USERCMS'] = $Username;</p>
<p>                   //The login is a smashing success, so redirect the user to the protected page.<br />
				   $MM_redirectWithSuccess = &quot;Successful_login.php&quot;;<br />
				   header(&quot;Location: &quot;. $MM_redirectWithSuccess );</p>
<p>        } else {<br />
        /We can&#8217;t log the user in, so display the login form again<br />
	$displayForm=true;<br />
        }</p>
<p>//unbind<br />
  ldap_unbind($ldapconn);</p>
<p>//*************************************<br />
}//end POST check</p>
<p>?&gt;<br />
&lt;!DOCTYPE html<br />
     PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;<br />
     &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</p>
<p>&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; &gt;</p>
<p>&lt;head&gt;<br />
&lt;title&gt;LDAP Login Form&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;h1&gt;Login&lt;/h1&gt;<br />
&lt;?php</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
  //Form variables to display previously filled out fields<br />
 $displayForm=true;<br />
 $ssoname=&#8221;;<br />
 $ssopass=&#8221;;<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>//Display the login form<br />
if ($displayForm){//Display the request form<br />
?&gt;</p>
<p>&lt;form action=&quot;&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;&quot; method=&quot;POST&quot; id=&quot;login&quot; name=&quot;login&quot;&gt;</p>
<p>UserID:<br />
&lt;input type=text size=30 name=&quot;ssoname&quot; maxlength=30 /&gt;</p>
<p>Password:<br />
&lt;input type=password size=30 name=&quot;ssopass&quot; maxlength=30 /&gt;<br />
&lt;br /&gt;</p>
<p> &lt;button type=&quot;submit&quot; value=&quot;submit&quot; name=&quot;submit&quot; &gt;Logon&lt;/button&gt;</p>
<p>&lt;/form&gt;</p>
<p>&lt;?php<br />
  }<br />
?&gt;</p>
<p>&lt;!&#8211; Javascript to move the cursor to the Username form field.  This is a small convenience to the user. &#8211;&gt;<br />
&lt;script type=&quot;text/javascript&quot; language=&quot;JavaScript&quot;&gt;<br />
document.forms['login'].elements['ssoname'].focus();<br />
&lt;/script&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/php]</p>
<p>To figure out how everything works, please read the comments within the code.  If you are interested in learning more, please check out Hugh&#8217;s excellent book:<br />
<iframe src="http://rcm.amazon.com/e/cm?t=gizwhi-20&#038;o=1&#038;p=8&#038;l=as1&#038;asins=0596005431&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=2970A6&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://lightyeardesign.com/2009/06/ldap-and-php-login-script/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Outlook rule to save attachments to a web directory</title>
		<link>http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/</link>
		<comments>http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 16:25:19 +0000</pubDate>
		<dc:creator>Thantos</dc:creator>
				<category><![CDATA[Office 2007]]></category>

		<guid isPermaLink="false">http://lightyeardesign.com/?p=13</guid>
		<description><![CDATA[If you are like me, you get a lot of email messages with attachments in your Outlook email account.  Wouldn&#8217;t it be nice to automate the migration of these attachments to a folder of your choosing?  Well, you can, and we will show you how. First off, it pays to research your particular topic. If [...]]]></description>
			<content:encoded><![CDATA[<p>If you are like me, you get a lot of email messages with attachments in your Outlook email account.  Wouldn&#8217;t it be nice to automate the migration of these attachments to a folder of your choosing?  Well, you can, and we will show you how.<span id="more-13"></span></p>
<p>First off, it pays to research your particular topic.  If you are looking for an excellent primer, you can find some good information in the following book:</p>
<p>At my job, we have web pages that are automatically generated and emailed to us.  We are tired of manually moving these files to the appropriate web directory (in this case, samba shares that are mapped with drive letters assigned to them).  So, the logical solution is to use Outlook <em>Rules</em> to push the attachments to the mapped drive.  However, Outlook rules have one limitation: you can move messages to specific folders, but moving attachments is another matter that is almost impossible to perform with the default Outlook Rules wizard.  So, we are going to use Outlook&#8217;s built in Visual Basic Editor to create some custom code to drive the attachment migration.  Here is how we did it:</p>
<ol>
<li>Open up Outlook.  I am using Outlook 2007, but this should also work in Outlook 2003.  Go to <em>Tools&gt;Macro&gt;Visual Basic Editor.<br />
</em></li>
<li>With your project folder highlighted (in the top left, in the PROJECT pane; I just used the default project, <strong>Project1</strong>), <del datetime="2010-03-29T16:23:46+00:00">right click and choose <em>Insert&gt;Module</em></del>, double-click <strong>Project1</strong>, and then double-click <strong>Microsoft Outlook Objects</strong>.  Double-click <strong>ThisOutlookSession</strong> to open a code window. <br />
<a href="http://lightyeardesign.com/wp-content/uploads/2009/04/outlook_rule_screenshot.jpg"><img src="http://lightyeardesign.com/wp-content/uploads/2009/04/outlook_rule_screenshot-300x159.jpg" alt="outlook_rule_screenshot" title="outlook_rule_screenshot" width="300" height="159" class="alignnone size-medium wp-image-105" /></a><br />
 Copy and paste the following code into the code window of the editor:<br />
<code>Sub SaveAttachmentsToDisk(Item As Outlook.MailItem)<br />
Dim olkFolder As Outlook.MAPIFolder, _<br />
olkAttachment As Outlook.Attachment, _<br />
objFSO As Object, _<br />
strRootFolderPath As String, _<br />
strFilename As String, _<br />
intCount As Integer<br />
'Change the following path to match your environment<br />
strRootFolderPath = "z:\www\departments\webreports\"<br />
Set objFSO = CreateObject("Scripting.FileSystemObject")<br />
Set olkFolder = Application.ActiveExplorer.CurrentFolder<br />
If Item.Attachments.Count &gt; 0 Then<br />
For Each olkAttachment In Item.Attachments<br />
If objFSO.GetExtensionName(LCase(olkAttachment.FileName)) = "htm" Then<br />
strFilename = olkAttachment.FileName<br />
intCount = 0<br />
Do While True<br />
If objFSO.FileExists(strRootFolderPath &amp; strFilename) Then<br />
intCount = intCount + 1<br />
objFSO.deletefile (strRootFolderPath &amp; strFilename)<br />
Else<br />
Exit Do<br />
End If<br />
Loop<br />
olkAttachment.SaveAsFile strRootFolderPath &amp; strFilename<br />
End If<br />
Next<br />
End If<br />
Set objFSO = Nothing<br />
Set olkAttachment = Nothing<br />
Set olkFolder = Nothing<br />
End Sub</code>
</li>
<li> You will need to ensure that you have the proper security level set in order to properly process the script.  In Outlook, go to <em>Tools&gt;Macro&gt; Security</em>.  I chose <em>No security check for macros</em>.  This might be too loose of a restriction for your environment; if so, try the next highest setting.</li>
<li>Create a new Outlook rule (<em>Tools&gt;Rules and Alerts</em>) to reflect your changes.  My rule looks for new messages from a specific email address and has an attachment (the web file that I want to move), moves the message to a specific folder (so I can have a backup of the message/attachment), then runs the module/script above to move the web file to the appropriate samba share.  Here is what my Rule Description looks like:
<pre><span style="color: #0000ff;">

Apply this rule after the message arrives
from <span style="text-decoration: underline;">joeuser@email.com
</span>and which has an attachment
and on this machine only
move it to the <span style="text-decoration: underline;"><span style="color: #0000ff;">WEBBACKUP</span></span> folder
and run <span style="text-decoration: underline;">Project1.SaveAttachmentsToDisk</span></span></pre>
</li>
<li>Hit Apply and OK to save your rule.  A couple of caveats: this is a client-side rule, so you must keep Outlook running in order for the rule to process.   Also, the code will overwrite any file (in my case, in the target samba share) that has the same name as the attachment.  If you only wish to make a copy, you can append a number to the attachment name.  To do so, replace this line of code:
<pre><span style="color: #0000ff;">objFSO.deletefile (strRootFolderPath &amp; strFilename)</span></pre>
<p>with</p>
<pre><span style="color: #0000ff;">strFilename = "Copy (" &amp; intCount &amp; ") of " &amp; olkAttachment.FileName </span></pre>
<p>That&#8217;s it!</li>
</ol>
<p>View additional details at this <a href="http://support.microsoft.com/kb/235852/EN-US/">Microsoft Support article</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>New look, new feel</title>
		<link>http://lightyeardesign.com/2009/04/hello-world/</link>
		<comments>http://lightyeardesign.com/2009/04/hello-world/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 09:25:47 +0000</pubDate>
		<dc:creator>Thantos</dc:creator>
				<category><![CDATA[Miscellany]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Lightyeardesign.com finally has a new look, after 4 years of stagnation (only in appearance, though&#8230;).  When one specializes in development for others, it can often be rather easy to neglect one&#8217;s own appearance. We finally bucked up to the suds, and the new look is born!]]></description>
			<content:encoded><![CDATA[<p>Lightyeardesign.com finally has a new look, after 4 years of stagnation (only in appearance, though&#8230;).  When one specializes in development for others, it can often be rather easy to neglect one&#8217;s own appearance. We finally bucked up to the suds, and the new look is born!</p>
]]></content:encoded>
			<wfw:commentRss>http://lightyeardesign.com/2009/04/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

