Solved

Can Outlook warn me before I send an email without an attachment?

Posted on 2006-07-20
3
1,413 Views
Last Modified: 2008-01-09
Dear Experts,

A disconcerting proportion of the time, I intend to send a message with an attachment, and yet I forget to actually
attach the file.  Much embarassment ensues :)

Is there a way to make Outlook do the following after I click the send button but before it actually gets sent:

1) Search for the string "attach" in the body of the message
2) If it finds that string, check to see that there is >0 attachments associated with the message
3) If there are zero attachments, warn me, and give the opportunity to stop the send

Can this be done?

Regards,

Patrick
0
Comment
Question by:Patrick Matthews
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 17147894
Happy Thursday, Patrick.

Yes, this can be done easily.  Here's what I use on my computer.  It checks for more strings than you mentioned .  You can remove the ones you don't want.  This code goes in ThisOutlookSession.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim arrWords As Variant, _
        strWord As Variant, _
        intResponse As Integer
    If Item.Class = olMail Then
        If Item.Sent = False Then
            arrWords = Array("enclosed", "attach","attached", "attachment")
            For Each strWord In arrWords
                If InStr(1, LCase(Item.Body), strWord) > 0 Then
                    If Item.Attachments.Count = 0 Then
                        intResponse = MsgBox("Did you forget to attach something?", vbYesNo + vbExclamation, "Attachment Check")
                        If intResponse = vbYes Then
                            Cancel = True
                        End If
                    End If
                    Exit For
                End If
            Next
        End If
    End If
End Sub



Cheers!
0
 
LVL 92

Author Comment

by:Patrick Matthews
ID: 17147968
Awesome!

Thank you very much, David :)

Patrick
0
 
LVL 76

Expert Comment

by:David Lee
ID: 17148208
Your welcome, Patrick.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Read this checklist to learn more about the 15 things you should never include in an email signature.
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now