<?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>Desi Penguin’s Blog &#187; VBA</title>
	<atom:link href="http://desipenguin.com/techblog/category/vba/feed/" rel="self" type="application/rss+xml" />
	<link>http://desipenguin.com/techblog</link>
	<description>Open source, Tech Tips, Reviews, Tutorials and more …</description>
	<lastBuildDate>Thu, 12 Jan 2012 18:16:35 +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>Outlook Macro source code</title>
		<link>http://desipenguin.com/techblog/2006/07/20/outlook-macro-source-code/</link>
		<comments>http://desipenguin.com/techblog/2006/07/20/outlook-macro-source-code/#comments</comments>
		<pubDate>Thu, 20 Jul 2006 01:34:00 +0000</pubDate>
		<dc:creator>Mandar Vaze</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[outlook]]></category>

		<guid isPermaLink="false">http://desipenguin.wordpress.com/2006/07/20/outlook-macro-source-code/</guid>
		<description><![CDATA[
This post is created only for the code, so that I can keep updating it.
The instructions are in the other post.
I do not take credit for this code. Original code for Attachment reminder available here.
I merely combined this with Reminder for missing subject. Similar code is available easily just by Googling.

*Update: Outlook counts files used [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li>This post is created only for the code, so that I can keep updating it.</li>
<li>The instructions are in the <a href="http://desipenguin.wordpress.com/2006/09/05/how-to-not-forget-attachment-or-subject-line-using-outlook-macro/" target="_blank">other post</a>.</li>
<li>I do not take credit for this code. Original code for Attachment reminder available <a href="http://mark.bird.googlepages.com/home">here</a>.</li>
<li>I merely combined this with Reminder for missing subject. Similar code is available easily just by Googling.</li>
</ul>
<p><em>*Update: Outlook counts files used in Signatures as attachments. see <a href="http://mark.bird.googlepages.com/home">here</a>. </em></p>
<p><span id="more-14"></span></p>
<pre>Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim strSubject As String
Dim m As Variant
Dim strBody As String
Dim intIn As Integer, intAttachCount As Integer
Dim x As Integer

intAttachCount = 0

strBody = LCase(Item.Body)
intIn = InStr(1, strBody, "original message")
If intIn = 0 Then
    intIn = Len(strBody)
    intIn = InStr(1, Left(strBody, intIn), "attach")
    If intIn &gt; 0 Then

        For x = 1 To Item.Attachments.Count
            If LCase(Item.Attachments.Item(x).DisplayName)  "picture (metafile)" Then
                intAttachCount = intAttachCount + 1
            End If
        Next

        If intAttachCount = 0 Then

            m = MsgBox("It appears that you mean to send an attachment," &amp; vbCrLf &amp; "but there is no attachment to this message." &amp; vbCrLf &amp; vbCrLf &amp; "Do you still want to send?", vbQuestion + vbYesNo + vbMsgBoxSetForeground)

            If m = vbNo Then
                Cancel = True
                Exit Sub
            End If
        End If
    End If
End If

strSubject = Item.Subject
If Len(Trim(strSubject)) = 0 Then
    Prompt$ = "Subject is Empty. Are you sure you want to send the Mail?"
    If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Subject") = vbNo Then
        Cancel = True
    End If
End If

End Sub</pre>
]]></content:encoded>
			<wfw:commentRss>http://desipenguin.com/techblog/2006/07/20/outlook-macro-source-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

