Platform SDK: Exchange Server

Modifying Rules

You can modify rules for folders using the new Rule component. Once you bind a CDO Folder object to an instance of the Rules COM class through the IRules::Folder property, you can enumerate the current rules for the folder. Each rule is represented as a Rule object within the Rules object. You can enumerate through the Rules until you find the Rule object that you are seeking. Parsing rule conditions is not trivial. You may find it easier to simply delete the old rule once you've found it, then create a new rule in its place. Don't forget to call the IRules::Update method to commit your changes to the store.