{"id":216,"date":"2016-11-28T16:56:17","date_gmt":"2016-11-28T16:56:17","guid":{"rendered":"https:\/\/gardinerfamily.wordpress.com\/?p=216"},"modified":"2016-11-28T16:56:17","modified_gmt":"2016-11-28T16:56:17","slug":"warn-about-missing-attachment-in-outlook-2010","status":"publish","type":"post","link":"http:\/\/gardiner.tech\/bluebook\/blog\/2016\/11\/28\/warn-about-missing-attachment-in-outlook-2010\/","title":{"rendered":"Warn About Missing Attachment In Outlook 2010"},"content":{"rendered":"<p>\t\t\t\tWhen you use Outlook 2010 and older, you need to use VBA or an add-in to warn about missing attachments.<\/p>\n<p>The following macro needs to go in ThisOutlookSession and runs when the message is sent. If it finds the word &#8220;attach&#8221; in the message body, it triggers a warning dialog.<\/p>\n<p><code>Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)<\/code><\/p>\n<p><code>Dim EndOfMsg, WordAttach As Integer<\/code><\/p>\n<p><code>EndOfMsg = InStr(1, Item.Body, \"From:\")<\/code><\/p>\n<p><code>WordAttach = InStr(1, Item.Body, \"attach\", vbTextCompare)<\/code><\/p>\n<p><code>If WordAttach &gt; 0 And WordAttach &lt; EndOfMsg Then<\/code><\/p>\n<p><code>\u00a0\u00a0\u00a0 If Item.Attachments.Count = 0 Then<\/code><\/p>\n<p><code>\u00a0\u00a0\u00a0\u00a0\u00a0 answer = MsgBox(\"There's no attachment, send anyway?\", vbYesNo)<\/code><\/p>\n<p><code>\u00a0\u00a0\u00a0\u00a0\u00a0 If answer = vbNo Then Cancel = True<\/code><\/p>\n<p><code>\u00a0\u00a0\u00a0 End If<\/code><\/p>\n<p><code>ElseIf EndOfMsg = 0 And WordAttach &gt; 0 Then<\/code><\/p>\n<p><code>\u00a0\u00a0\u00a0 If Item.Attachments.Count = 0 Then<\/code><\/p>\n<p><code>\u00a0\u00a0\u00a0\u00a0\u00a0 answer = MsgBox(\"There's no attachment, send anyway?\", vbYesNo)<\/code><\/p>\n<p><code>\u00a0\u00a0\u00a0\u00a0\u00a0 If answer = vbNo Then Cancel = True<\/code><\/p>\n<p><code>\u00a0\u00a0\u00a0 End If<\/code><\/p>\n<p><code>End If<\/code><\/p>\n<p><code>End Sub<\/code>\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you use Outlook 2010 and older, you need to use VBA or an add-in to warn about missing attachments. The following macro needs to go in ThisOutlookSession and runs when the message is sent. If it finds the word &#8220;attach&#8221; in the message body, it triggers a warning dialog. Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim EndOfMsg, WordAttach As Integer EndOfMsg = InStr(1, Item.Body, &#8220;From:&#8221;) WordAttach = InStr(1, Item.Body, &#8220;attach&#8221;, vbTextCompare) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[47],"tags":[],"_links":{"self":[{"href":"http:\/\/gardiner.tech\/bluebook\/wp-json\/wp\/v2\/posts\/216"}],"collection":[{"href":"http:\/\/gardiner.tech\/bluebook\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/gardiner.tech\/bluebook\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/gardiner.tech\/bluebook\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/gardiner.tech\/bluebook\/wp-json\/wp\/v2\/comments?post=216"}],"version-history":[{"count":0,"href":"http:\/\/gardiner.tech\/bluebook\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"wp:attachment":[{"href":"http:\/\/gardiner.tech\/bluebook\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gardiner.tech\/bluebook\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gardiner.tech\/bluebook\/wp-json\/wp\/v2\/tags?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}