?
Solved

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

Posted on 2006-07-20
3
Medium Priority
?
1,438 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 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 93

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
Mailbox Overload?
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

752 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