We help IT Professionals succeed at work.

Outlook: Rules Wizard - Need to Export or Edit Contents of a Particular Rule

Jerry L
Jerry L asked
Last Modified: 2009-07-29
       Description of Problem
I've created a custom rule with the Rules Wizard that has a list of entries in it.  The rule is that, when these phrases appear in the email header, the message should be moved to another folder.  

         Apply this rule after the message arrives
         with __________ in the message header
When you click on the area of text after "with", the entries appear in a scrollable dialog box with a text box which allows you to add or remove items.  When this list gets above 100 items, however, it gets unmanageable and difficult to see what entries are invalid or duplicates.

          My Question
I'm looking for a way to edit this list in an external editor and clean it up, delete invalid entries that I don't want.   I've tried using a HexEdit tool but that does not lend itself to the task.  Unlike the "Safe Senders" and "Junk Senders" lists, I don't see a way to export this type of Rules list.  

Does anyone have another method or idea?

          Question Part 2
Also, I'm not sure which file these phrases are being stored in.  Here is a list of files in my settings folder:

C:\Documents and Settings\User\Application Data\Microsoft\Outlook

1. This one seems very old, so I wonder if it is even being used anymore; so which file is it?  RWZ stands for Rules Wizard but I don't understand why the date hasn't been updated since I use it all the time.  Must be another file...
             Microsoft Outlook Internet Settings.RWZ     20 KB       1/23/2006

2. This one is dated recently and has a larger file size.  What does NK or NICK and SRS stand for?
             Microsoft Outlook Internet Settings.NK2    887 KB       7/5/2007

3.         Microsoft Outlook Internet Settings.NICK       1 KB     12/5/2006
4.         Microsoft Outlook Internet Settings.srs          4 KB     12/5/2006
5.         Microsoft Outlook Internet Settings~7.srs      8 KB      6/5/2007

Miscellaneous Files:
6.         outitems.log                                              1,410 KB     7/5/2007
7.         Microsoft Outlook Internet Settings.xml           4 KB     7/5/2007
8.         OutlPrnt                                                          39 KB     7/5/2007
9.         outcmd.dat                                                     15 KB     7/5/2007        

     My System:
Microsoft Windows XP SP2
Outlook 2003 (comes with Office 2003)
Watch Question

kzabbottSenior Systems Administrator
This one is on us!
(Get your first solution completely free - no credit card required)
Senior Systems Administrator
This one is on us!
(Get your first solution completely free - no credit card required)
Jerry LOperations Manager


Glenn - I didn't see anything directly relevant to help in my situation.  Thanks for the input nonetheless.

Kzabbott - Thanks for defining the file name extensions, points for that.
Also, your link to the scripting Guys at Microsoft Tech Center is quite helpful, pts for that as well.  

I am going to submit another EE question in which I'd ask for an example script that looks for content in the Headers and moves that message to a folder.  If you'd be willing to do that, more points will be available.
Jerry LOperations Manager


If you can help me write this script, please refer to this EE Question:
kzabbottSenior Systems Administrator

Thanks for the points WizeOwl.  I wish I were adept at scripting and could help you in that area, but alas I am not - I just know it can likely be done that way.  Good luck!

Here's a basic script for exporting the rule title and a few types of rule contents to a text file.  Combine that with some assistance from "Sub CreateRule()" from http://msdn.microsoft.com/en-us/library/bb206765.aspx, and you should be able to display or modify your rules lists as necessary.

Sub DumpRule()

    Dim colRules As Outlook.Rules
    Dim oRule As Outlook.Rule
    Dim colRuleActions As Outlook.RuleActions
    Dim s As String
    Open "E:\subjectdump.txt" For Output As #1
    'Specify target folder for rule move action
    Set oInbox = Application.Session.GetDefaultFolder(olFolderInbox)
    'Get Rules from Session.DefaultStore object
    Set colRules = Application.Session.DefaultStore.GetRules()
    For i = 1 To colRules.Count
    ' Get each rule item one at a time.  As long as you're not modifying the rules list, you can probably use a ForEach
        s = ""
        Set oRule = colRules.Item(i)
        Print #1, "---------------------------------------------------------------------------------"
        Print #1, "+++ " & oRule.Name & " +++"
        Print #1, ""
        If (Not (IsEmpty(oRule.Conditions.Subject.Text))) Then
            Print #1, "+++ Subject contains... +++"
            Print #1, ""
            For i2 = LBound(oRule.Conditions.Subject.Text) To UBound(oRule.Conditions.Subject.Text)
                Print #1, oRule.Conditions.Subject.Text(i2)
            Next i2
        ElseIf (Not (IsEmpty(oRule.Conditions.Body.Text))) Then
            Print #1, "+++ Body contains... +++"
            Print #1, ""
            For i2 = LBound(oRule.Conditions.Body.Text) To UBound(oRule.Conditions.Body.Text)
                Print #1, oRule.Conditions.Body.Text(i2)
            Next i2
        ElseIf (Not (IsEmpty(oRule.Conditions.BodyOrSubject.Text))) Then
            Print #1, "+++ Body OR subject contains... +++"
            Print #1, ""
            For i2 = LBound(oRule.Conditions.BodyOrSubject.Text) To UBound(oRule.Conditions.BodyOrSubject.Text)
                Print #1, oRule.Conditions.BodyOrSubject.Text(i2)
            Next i2
        ElseIf (Not (IsEmpty(oRule.Conditions.MessageHeader.Text))) Then
            Print #1, "+++ Message Headers contains... +++"
            Print #1, ""
            For i2 = LBound(oRule.Conditions.MessageHeader.Text) To UBound(oRule.Conditions.MessageHeader.Text)
                Print #1, oRule.Conditions.MessageHeader.Text(i2)
            Next i2
        End If
        Print #1, ""
        Print #1, ""
    Next i
    Print #1, "---------------------------------------------------------------------------------"
    Close #1
End Sub
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.