<?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>Shami's Blog &#187; VBA</title>
	<atom:link href="http://blog.al-shami.net/index.php/tag/vba/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.al-shami.net</link>
	<description>A Mushroom A Day Keeps The Koopas Away</description>
	<lastBuildDate>Thu, 13 May 2010 06:15:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Signatures with date fields in Microsoft Outlook</title>
		<link>http://blog.al-shami.net/index.php/signatures-with-date-fields-in-microsoft-outlook/</link>
		<comments>http://blog.al-shami.net/index.php/signatures-with-date-fields-in-microsoft-outlook/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 15:43:19 +0000</pubDate>
		<dc:creator>Mohammad Al-Shami</dc:creator>
				<category><![CDATA[Mail]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Date]]></category>
		<category><![CDATA[date field]]></category>
		<category><![CDATA[date stamp]]></category>
		<category><![CDATA[Outlook]]></category>
		<category><![CDATA[signature]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://blog.al-shami.net/?p=8</guid>
		<description><![CDATA[Ok, so today our CEO said he wanted everybody to stamp their emails with the sending date. It&#8217;s very simple to just add the date manually, but as you know, a good engineer is a lazy engineer. So this is how I did it:
Add &#8220;$$MYDATE$$&#8221; to your signature but without the quotes, then add this [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so today our CEO said he wanted everybody to stamp their emails with the sending date. It&#8217;s very simple to just add the date manually, but as you know, a good engineer is a lazy engineer. So this is how I did it:</p>
<p>Add &#8220;$$MYDATE$$&#8221; to your signature but without the quotes, then add this simple script to VBA:</p>
<pre>
<code>
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    If Item.Class = olMail Then
        Dim Signature As String
        Signature = Format(Now(), "d/m/yyyy")
        Item.HTMLBody = Replace(Item.HTMLBody, "$$MYDATE$$", Signature, , 1)
    End If
End Sub
</code></pre>
<p>This should do it. This script will replace $$MYDATE$$ with the current date as soon as you hit the &#8220;Send&#8221; button. So you will still see &#8220;$$MYDATE$$&#8221; while you&#8217;re typing the message.</p>
<p>Just make sure you lower the macro security to medium.</p>
<p>Hope that helps</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.al-shami.net/index.php/signatures-with-date-fields-in-microsoft-outlook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
