Well, it's probably the VBScript of the year from me, but here goes;
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If (InStr(1, Item.Body, "attached", vbTextCompare) > 0 Or InStr(1, Item.Body, "attachment", vbTextCompare) > 0) Then
If Item.Attachments.Count = 0 Then
Application.ActiveInspector.Activate
ans = MsgBox("It looks like you may have forgotten an attachment, would you like to send the e-mail now?", vbYesNo)
If ans = vbNo Then Cancel = True
End If
End If
End Sub
Now, the only thing this script does is scan your mail text and look for attachment-words (in this case, "attached" & "attachment", in my own version I added some Norwegian words as well), and if they exist and there are no files attached, a message box appears, offering to stop the mail from leaving you un-attached.
Thanks to these guys for the code.
Note: Line 2 is cropped above, but if you copy all the code at once you'll be sure to get everything :)
Posted by: Rune Skaug | 20 May 2007 at 00:39
I was thrown out of college for cheating on the metaphysics exam: I looked into the soul of another boy.
Posted by: Air Jordan | 09 March 2011 at 09:11