I'm one of those people who forgets to attach files to emails. I found some code on slipstick.com that identifies emails that contains "attach" in the message body and checks if they have a file attached. If there is no file attached this prompts message box (see code below).
This works OK but has one limitation: Quite a few people have the word 'attachment' in the disclaimer section of their email signature. If I reply to such an email the code identifies it as a message I meant to attach a file to, even if I haven't used the word attachment in my message. This happen enough to be a nuisance.
I'm wondering if their is way to restrict what part of the message body the code below looks in for "attach", ideally I would like to only search in the new text I have just created.
One idea I have thought of so far is for it to stop checking when it encounters "---Original Message".
However the InStr function doesn't support any kind of Stop argument. So I'm a bit stumped.
CODE
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If InStr(1, Item.Body, "attach", vbTextCompare) > 0 Then
If Item.Attachments.Count = 0 Then
answer = MsgBox("There's no attachment, send anyway?", vbYesNo)
If answer = vbNo Then
Cancel = True
End If
End If
End Sub