編輯

共用方式為


_Rules.Create(String, OlRuleType) Method

Definition

Creates a Rule object with the name specified by Name and the type of rule specified by RuleType.

public:
 Microsoft::Office::Interop::Outlook::Rule ^ Create(System::String ^ Name, Microsoft::Office::Interop::Outlook::OlRuleType RuleType);
public Microsoft.Office.Interop.Outlook.Rule Create (string Name, Microsoft.Office.Interop.Outlook.OlRuleType RuleType);
Public Function Create (Name As String, RuleType As OlRuleType) As Rule

Parameters

Name
String

A string identifier for the rule, which will be represented by Name after rule creation. Names of rules in a collection are not unique.

RuleType
OlRuleType

A constant in the OlRuleType enumeration that determines whether the rule is applied on sending or receiving a message.

Returns

A Rule object that represents the newly created rule.

Remarks

The RuleType parameter of the added rule determines valid rule actions, rule conditions, and rule exception conditions that can be associated with the Rule object.

When a rule is added to the collection, the ExecutionOrder of the new rule is 1. The ExecutionOrder of other rules in the collection is incremented by 1.

Applies to