IExchangeFolderRules::HrInsert

The HrInsert method inserts a new rule into the set of rules for the folder.

HRESULT HrInsert(
  LONG lState,                   
  LPSRestriction lpRestriction,  
  LPACTIONS lpActions,           
  LONG lLevel,                   
  LPSTR lpszName                 
);
 

Parameters

lState
Input parameter. Points to a LONG value containing the rule state.
lpRestriction
Input parameter. Points to a MAPI SRestriction structure containing the conditions for the rule.
lpActions
Input parameter. Points to an ACTIONS structure containing the actions for the rule.
lLevel
Input parameter. Points to a LONG value containing the nesting level of the rule.
lpszName
Input parameter. Points to a string containing the name of the rule.

Return Values

See Return Values.

When creating, modifying, or deleting rules, the MAPI_W_PARTIAL_SUCCESS error is returned if at least one rule operation (create, modify, or delete) is successful, but not all the operations are successful. A rule operation fails under the following circumstances:

  1. The rule condition is invalid.
  2. The rule action is missing or invalid.
  3. A non-string property type has been given for a rule provider name or a rule name.
  4. A rule property is invalid.

Remarks

For additional information, see RULEEDIT: Manipulating Rules.

See Also

ACTIONS, IExchangeFolderRules