c# - How to check all rules which can be applied to a mailItem in Outlook -


I am writing an application that can be matched with the rules. // New Messages Here are the empty items IITemAdd (Object Items) {// All Rule Rules Rule = Application. Session Default store.gatereal (); Outlook.MailItemmail = (Outlook.MailItem) items; If (mail! = Null) {// I have to find out that mail matches a rule and handle it in a proper way}}

The only way to check which items are applied ( and ) for each MailItem . Rule engine works by executing each rule you define - it does not provide a mechanism to preview the affected objects.

There is an example ( untested ) in this context to match a subject rule ( olConditionSubject ) to you too Will need to handle. {Mailout = null} {foreach (rules in rules) {foreach (rule.Conditions in Outlook. Terms condition condition) {if (condition is TextRuleCondition) {Outlook.TextRuleCondition Trc = betting Outlook.TextRuleCondition; If (trc.ConditionType == Outlook.OlRuleConditionType.olConditionSubject) {/ TODO: Control the rule. Exception statuses boolSubject = mail.Subject.Contains (trc.Text); }}}}}

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -