{"id":416,"date":"2015-02-25T09:42:31","date_gmt":"2015-02-25T08:42:31","guid":{"rendered":"http:\/\/dev.flauschig.ch\/wordpress\/?p=416"},"modified":"2015-02-25T09:42:31","modified_gmt":"2015-02-25T08:42:31","slug":"prevent-outlook-from-sending-mails-without-subject-or-missing-attachments","status":"publish","type":"post","link":"http:\/\/dev.flauschig.ch\/wordpress\/?p=416","title":{"rendered":"Prevent Outlook from sending mails without subject or missing attachments"},"content":{"rendered":"<p>All of us have done it: sending a mail without a subject or sending a mail where we wanted to attach something and forgot to attach it.<\/p>\n<p>The following code-snipped can be added to the Visual Basic Editor (Alt-F11) to show a warning if the subject is empty or in the body is the text &#8220;attach&#8221; or &#8220;anhang&#8221;.<\/p>\n<pre class=\"lang:vb decode:true \">Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)\r\n    If Item.Subject = \"\" Then\r\n        Cancel = MsgBox(\"There's no subject, send anyway?\", vbYesNo + vbExclamation, \"No Subject\") = vbNo\r\n    End If\r\n \r\n    If InStr(1, Item.Body, \"attach\", vbTextCompare) > 0 Or InStr(1, Item.Body, \"anhang\", vbTextCompare) > 0 Then\r\n        If Item.Attachments.Count = 0 Then\r\n            answer = MsgBox(\"There's no attachment, send anyway?\", vbYesNo)\r\n            If answer = vbNo Then Cancel = True\r\n        End If\r\n    End If\r\nEnd Sub<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>All of us have done it: sending a mail without a subject or sending a mail where we wanted to attach something and forgot to attach it. The following code-snipped can be added to the Visual Basic Editor (Alt-F11) to show a warning if the subject is empty or in the body is the text &hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-roemer","4":"post-416","6":"format-standard","7":"category-uncategorized"},"acf":[],"views":1919,"_links":{"self":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/416"}],"collection":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=416"}],"version-history":[{"count":0,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/416\/revisions"}],"wp:attachment":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=416"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}