Partager via


_Rule.Conditions Property

Returns a RuleConditions collection object that represents all the available rule conditions for the rule. Read-only.

Namespace:  Microsoft.Office.Interop.Outlook
Assembly:  Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)

Syntax

'Declaration
<DispIdAttribute()> _
ReadOnly Property Conditions As RuleConditions
    Get
'Usage
Dim instance As _Rule
Dim value As RuleConditions

value = instance.Conditions
[DispIdAttribute()]
RuleConditions Conditions { get; }

Property Value

Type: Microsoft.Office.Interop.Outlook.RuleConditions

Remarks

A condition for a rule states the condition under which the rule should be applied. Both the Conditions and Exceptions properties share the same pool of conditions and return a corresponding RuleConditions collection object.

Programmatically you can enumerate and enable rules with any rule condition that the Rules and Alerts Wizard support, but you can create rules that have only the most commonly used rule conditions, and not any rule condition that the Rules and Alerts Wizard supports. For more information on rule condition support, see Specifying Rule Conditions.

Through the Conditions property, each rule is associated with a RuleConditions object. The RuleConditions collection is a fixed object - you cannot add or remove items from this collection. Rule conditions that are enabled in the rule will have an enabled rule condition in the RuleConditions collection. Rule conditions that are not enabled in the rule will have a rule condition in this collection that has the _RuleCondition.Enabled property set to False. Rule conditions that are not supported during programmatic rule creation can only be enumerated in the RuleConditions collection for an existing rule, but because the RuleConditions collection is fixed, you cannot create a rule and add such a condition to the associated RuleConditions collection.

See Also

Reference

_Rule Interface

_Rule Members

Microsoft.Office.Interop.Outlook Namespace

Other Resources

How to: Create a Rule to File Mail Items from a Manager and Flag Them for Follow-Up

How to: Create a Rule to Assign Categories to Mail Items Based on Multiple Words in the Subject