Solved

Outlook 2010 Custom Rules

Posted on 2010-11-20
3
823 Views
Last Modified: 2012-05-10
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
Comment
Question by:tatton777
3 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 34181121
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
 
LVL 14

Expert Comment

by:BigBadWolf_000
ID: 34183632
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
 
LVL 13

Accepted Solution

by:
gbanik earned 500 total points
ID: 34183951
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
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…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

813 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now