Solved

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

Posted on 2006-07-20
3
1,431 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 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

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…
Read this checklist to learn more about the 15 things you should never include in an email signature.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

705 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