<?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>Shlrm.org Blag &#187; Visual Basic</title>
	<atom:link href="http://shlrm.org/wordpress/tag/visual-basic/feed/" rel="self" type="application/rss+xml" />
	<link>http://shlrm.org/wordpress</link>
	<description>Linux, Java, Ruby, and Politics.</description>
	<lastBuildDate>Mon, 10 Oct 2011 18:50:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>HOWTO: rewrite an email address on send in outlook</title>
		<link>http://shlrm.org/wordpress/2008/07/30/howto-rewrite-an-email-address-on-send-in-outlook/</link>
		<comments>http://shlrm.org/wordpress/2008/07/30/howto-rewrite-an-email-address-on-send-in-outlook/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 12:24:17 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Coding!]]></category>
		<category><![CDATA[Visual Basic]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=118</guid>
		<description><![CDATA[I&#8217;m not terribly big on microsoft products, but I have to use them at work. I was emailing someone whos reply-to address was incorrect, so I needed to rewrite it on send. It was terribly annoying to have to remember to replace it everytime I hit &#8220;reply.&#8221; Here&#8217;s some code that does it. Private Sub <a href='http://shlrm.org/wordpress/2008/07/30/howto-rewrite-an-email-address-on-send-in-outlook/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not terribly big on microsoft products, but I have to use them at work. I was emailing someone whos reply-to address was incorrect, so I needed to rewrite it on send. It was terribly annoying to have to remember to replace it everytime I hit &#8220;reply.&#8221;</p>
<p>Here&#8217;s some code that does it.</p>
<pre lang="vbasic">
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    'Trying to rewrite an email address on send
    Dim item2 As MailItem
    If TypeOf Item Is MailItem Then
        Set item2 = Item
        Dim str As String
        Dim r As Recipient
        For Each r In item2.Recipients
        If r.Address = "old.address@someplace.net" Then
            r.Delete
            Dim newRecipient As Recipient
            Set newRecipient = item2.Recipients.Add("new.address@something.more.useful.com")
            newRecipient.Type = olTo
            newRecipient.Resolve
        End If
        Next
    End If
End Sub
</pre>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2008/07/30/howto-rewrite-an-email-address-on-send-in-outlook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

