Um script VBA
como o seguinte poderia fazer o trabalho:
Option Explicit
Sub DoubleSimonMessageRule(newMail As Outlook.mailItem)
Dim a() As String ' we convert the mail body to an array of string
Dim EntryID As String
Dim StoreID As Variant
Dim mi As Outlook.mailItem
Dim dest As String
Dim destFldr As Outlook.Folder
Dim I As Integer
Dim iMatch As Integer
Const pattern = "Simon"
Const dest1 = "Simon1" ' destination folder for 1 match
Const destAny = "SimonAny" ' destination folder for 2+ matches
On Error GoTo ErrHandler
' we have to access the new mail via an application reference
' to avoid security warnings
EntryID = newMail.EntryID
StoreID = newMail.Parent.StoreID
Set mi = Application.Session.GetItemFromID(EntryID, StoreID)
a = Split(mi.body, vbCrLf)
iMatch = 0
For I = LCase(a) To UCase(a)
If InStr(1, a(I), pattern, vbTextCompare) Then
iMatch = iMatch + 1
End If
Next I
If iMatch < 1 Then
' this should not happen, provided our rule is configured properly
Err.Raise 1, , "No " & pattern & " in Mail"
ElseIf iMatch = 1 Then
dest = dest1
ElseIf iMatch > 1 Then
dest = destAny
End If
Set destFldr = Application.GetNamespace("MAPI").Folders(dest)
mi.Move destFldr
' mi.Delete ' not sure about this!
Set mi = Nothing
Exit Sub
ErrHandler:
Debug.Print Err.Description
Err.Clear
On Error GoTo 0
End Sub
Use o Assistente de regras do Outlook para chamar esse script de mensagens de entrada que tenham "Simon" em seu corpo de e-mail.