No Attachment Warning - VBA Code HELP



I had this code in Outlook 2003 it warned me when I sent email without
attachment if it found the word attached in the email.

It doesn't work in Outlook 2007, please help. Thanks.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim lngres As Long
If InStr(1, Item.Body, "attach") <> 0 Then
If Item.Attachments.Count = 0 Then

lngres = MsgBox(" Found 'Attach' in message, but no attachment found - send
anyway?", _

vbYesNo + vbDefaultButton2 + vbQuestion, "You asked me to warn you...")

If lngres = vbNo Then Cancel = True

End If

End If
End Sub


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question