Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Mozilla Thunderbird has a function to give me a reminder in case I forget to enclose an attachment but use the word "attachment" (or other words, I can define my own list) in the e-mail text.

I've been looking for a similar function in Microsoft Outlook, but can't find it. Only a vague macro from a third party.

Does somebody know about a way to achieve this in Outlook?

share|improve this question
Not natively, no. Not without a vague macro anyway. It's a setting I wanted years ago before I switched to Google Mail. – user3463 May 16 '12 at 7:23

I don't think there is any standard way. Here is another VBA macro which is more dynamic than the one you've already found by using regexp:

Option Explicit
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
   Dim regEx As New VBScript_RegExp_55.RegExp
   Dim Match, Matches
   Dim mail As MailItem

   ' Check if this is a mail
   If Not Item.Class = olMail Then Exit Sub

   Set mail = ActiveInspector.CurrentItem

   ' Check if the user forgot the attachment
   Set regEx = New RegExp
   regEx.IgnoreCase = True
   regEx.Global = True
   If mail.Attachments.Count = 0 Then ' no attachment
       Dim s As String
       s = mail.Body
       ' remove previous answers from the convesation (for Outlook 2003)
       If InStr(1, s, "_", vbTextCompare) <> 0 Then
           s = Mid(s, 1, InStr(1, s, "_", vbTextCompare))
       End If
       ' if the message is not in HTML
       If InStr(1, s, "-Message d'origine-", vbTextCompare) <> 0 Then
           s = Mid(s, 1, InStr(1, s, "-Message d'origine-", vbTextCompare))
       End If

       regEx.Pattern = "(^|^\w+)(attachment|joined|here is|document|linked)^\w+"
       Set Matches = regEx.Execute(s)
       If Matches.Count > 0 Then
           Cancel = MsgBox("VYou may have forgotten to join the attachment. Are you sure you want to send your mail ?", vbYesNo + vbExclamation, "Missing attachment!") = vbNo
       End If
   End If
End Sub

Note that you can translate every keyword to you current language.

[EDIT] Here is a link explaining how to add a macro to Outlook

[EDIT] You can also find some paid solutions

share|improve this answer
Sounds great, thank you very much for your code. Could you amend your answer just a little bit, how to use this code? How do I trigger outlook to use this macro every time I send an email? – Keks Dose Jan 14 '13 at 13:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .