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

Jerry L
Jerry L used Ask the Experts™
on
--------------------------------------
       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)
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
kzabbottSenior Systems Administrator
Commented:
WizeOwl,

Regarding the different file types:

.NK2 file is Outlook Nicknames for AutoComplete;
.NICK are nicknames for AutoResolution
.SRS are send/receive group settings

.RWZ  is the Rules Wizard file and that what you are looking for, although the specific rule you are looking for may not be where you think it is.  You can definitely export your rule to a rwz file that you can put wherever you want and call it something so you will know what it is (My Documents\WizeOwl_Filter.rwz).  Once edited, you can re-import it.

Editing it, however, which I understand to be the core of your question, is a different subject.  Unfortunately as you have found this is not just a text file and there does not seem to be an available editor for .rwz files other than the Outlook Rules Wizard itself.

That said, there must be a way create a new rule using a script, although again I unfortunately do not have the experience or expertise to write such a script for you.  Still, I would encourage you to look in that direction.
Senior Systems Administrator
Commented:
Found this, which may lead you in the right direction as far as creating a script to do what you need:
http://www.microsoft.com/technet/scriptcenter/resources/officetips/aug05/tips0818.mspx
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Jerry LOperations Manager

Author

Commented:
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

Author

Commented:
If you can help me write this script, please refer to this EE Question:
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Q_22681386.html
kzabbottSenior Systems Administrator

Commented:
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!

Commented:
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
 

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial