{"id":2390,"date":"2007-02-25T11:46:00","date_gmt":"2007-02-25T11:46:00","guid":{"rendered":"https:\/\/www.jameshatton.co.uk\/blog\/?p=2390"},"modified":"2024-02-25T00:55:39","modified_gmt":"2024-02-25T00:55:39","slug":"microsoft-outlook-attachment-reminder","status":"publish","type":"post","link":"https:\/\/www.jameshatton.co.uk\/blog\/2007\/02\/25\/microsoft-outlook-attachment-reminder\/","title":{"rendered":"Microsoft Outlook Attachment Reminder"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This Outlook macro will politely remind you to attach a file if it finds the word \u201cattach\u201d in your email and no actual attached file.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\">In Outlook, go to Tools > Macro > Visual Basic Editor and expand the project by clicking the plus signs under Project1 until you see ThisOutlookSession &#8211; and double-click it. Copy-paste the code below in the empty page.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: vb; title: ; notranslate\" title=\"\">\nPrivate Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) \nDim m As Variant \nDim strBody As String \nDim intIn As Long \nDim intAttachCount As Integer, intStandardAttachCount As Integer \n\t\tOn Error GoTo handleError \n\t\t&#039;Change 0 below, to number of files in signature\n\t\tintStandardAttachCount = 0 \n\t\tstrBody = LCase(Item.Body) \n\t\tintIn = InStr(1, strBody, &quot;original message&quot;) \n\t\tIf intIn = 0 Then intIn = Len(strBody) \n\t\tintIn = InStr(1, Left(strBody, intIn), &quot;attach&quot;) \n\t\tintAttachCount = Item.Attachments.Count \nIf intIn &gt; 0 And intAttachCount &lt;= intStandardAttachCount Then\n  \n    m = MsgBox(&quot;It appears that you mean to send an attachment,&quot; &amp; vbCrLf &amp; &quot;but there is no attachment to this message.&quot; &amp; vbCrLf &amp; vbCrLf &amp; &quot;Do you still want to send?&quot;, vbQuestion + vbYesNo + vbMsgBoxSetForeground) \n\t\tIf m = vbNo Then Cancel = True \n     \nEnd If \n\t\thandleError: \n\t\tIf Err.Number &lt;&gt; 0 Then \n    MsgBox &quot;Outlook Attachment Reminder Error: &quot; &amp; Err.Description, vbExclamation, &quot;Outlook Attachment Reminder Error&quot; \nEnd If \nEnd Sub\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Click Save and and ensure macros aren&#8217;t disabled (if previously disabled).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This Outlook macro will politely remind you to attach a file if it finds the word \u201cattach\u201d in your email and no actual attached file.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[82],"tags":[78],"class_list":["post-2390","post","type-post","status-publish","format-standard","hentry","category-ict-issues","tag-programming"],"featured_image_src":null,"author_info":{"display_name":"james","author_link":"https:\/\/www.jameshatton.co.uk\/blog\/author\/james\/"},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p89zH1-Cy","jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=2390"}],"version-history":[{"count":5,"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2390\/revisions"}],"predecessor-version":[{"id":2395,"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2390\/revisions\/2395"}],"wp:attachment":[{"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=2390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=2390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=2390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}