附件提醒 Outlook

附件提醒 Outlook

Mozilla Thunderbird 具有提醒功能,以防我忘记附上附件,但在电子邮件文本中使用“附件”一词(或其他词语,我可以定义自己的列表)。

我一直在寻找 Microsoft Outlook 中的类似功能,但找不到。只有一个模糊的来自第三方。

有人知道在 Outlook 中实现这一点的方法吗?

答案1

我认为没有任何标准方法。这是另一个 VBA 宏,它比您已经使用正则表达式找到的宏更具动态性:

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

请注意,您可以将每个关键字翻译成您当前的语言。

以下是一些解释如何向 Outlook 添加宏的文档:

您还可以找到一些付费解决方案

相关内容