One thing that took me a week or two to figure out, with the help of MS Support: When you put your new rule into the user's mailbox, ALL rules (old ones and your new one) are checked for validity. If any rules are deemed invalid at that point, your "oRules.Update" fails. The return code/message? Why, "Unspecified Error", of course.
What can you expect to trigger this? Any client-side rules, because you're not creating your rule(s) from within the client. Also, any #NET FOLDERS# hidden item. These are created when you access your a mailbox for the first time on a PC with Outlook 2000. Go to another PC, make your profile, logon to Outlook 2000, and you've got another #NET FOLDERS# hidden item in your Inbox. So before adding a rule via Rule.dll, you have to delete all #NET FOLDER# hidden items from the Inbox.
We're implementing a spam-catching scheme, and Rule.dll has given me many hours of enjoyment (I love solving mysteries!).
--
jcf
Documentation is in MSDN. I should have a link at
http://www.slipstick.com/dev/exstech.htm. Note its limitations -- server-side rules only and those rules don't appear in RUles Wizard, so you run the risk of getting support calls from users who can't figure out why their messages are doing things they didn't tell them to do.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at
http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.slipstick.com/books/jumpstart.htm