[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 829
  • Last Modified:

Outlook 2010 Custom Rules

Hello,

I would like to setup a couple of custom rules in Outlook 2010 and I'm not sure how to do it.

Here are the rules

1. If there is no subject, put email into folder \Suspicious

2. If the body of the email is a hyperlink and nothing but a hyperlink then put in folder \Suspcious
0
tatton777
Asked:
tatton777
1 Solution
 
David LeeCommented:
Hi, tatton777.

The second rule isn't possible with Outlook alone.  Outlook does not have a rule option for doing this.  It might be possible with a bit of scripting in concert with a rule.  I don't think the first rule can be done with Outlook alone either, but it can be done with a bit of scripting and a rule.  I can provide the script and instructions for using it if you want to go with this approach.
0
 
BigBadWolf_000Commented:
For 1) you can try this....
Apply this rule afer message arrives
Where my name is in the to or cc box
Move it to the Suspicious folder
Except if the subject contains 'a' or 'e' or 'i' or 'o' or 'u' or 'f' or 'w'

 If you dont want emails with FW: in the subject line included remove the 'f' or 'w'

For 2) you can try "with spaecific words in body" and include http://
and Move it to the Suspicious folder



0
 
gbanikCommented:
The only way you can achieve all of this is through VBA... attached is the code to do so.

FYI, for adding the code to your Outlook project,
1. Click Tools > Macro > Visual Basic Editor
2. Expand Microsoft Office Outlook Objects and click on ThisOutlookSession
3. Copy the code and paste it into the Outlook's VB Editor window
4. Save the code from the Toolbar Save button.
5. Wait for a mail :)
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
    Dim varEntryIDs
    Dim objItem As MailItem
    Dim objNS As NameSpace
    Dim oFolder As Folder
    
    Set objNS = Application.Session
    Set oFolder = objNS.Folders("Personal Folders").Folders("Suspicious")
    
    Dim i As Integer
    varEntryIDs = Split(EntryIDCollection, ",")
    For i = 0 To UBound(varEntryIDs)
        Set objItem = objNS.GetItemFromID(varEntryIDs(i))
        If TypeName(objItem) = "MailItem" Then
            objItem.Move oFolder
        End If
    Next
End Sub

Open in new window

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now