When I receive e-mail I need check mail body. And I have keywords-more than thousand- If mail has that words, rules should be move to a specific folder. I use this script:
CreateRule()
Dim colRules As Outlook.rules
Dim oRule As Outlook.Rule
Dim colRuleActions As Outlook.RuleActions
Dim oMoveRuleAction As Outlook.MoveOrCopyRuleAction
Dim oFromCondition As Outlook.ToOrFromRuleCondition
Dim oExceptSubject As Outlook.TextRuleCondition
Dim oInbox As Outlook.Folder
Dim oMoveTarget As Outlook.Folder
Set oInbox = Application.Session.GetDefaultFolder(olFolderInbox)
Set oMoveTarget = oInbox.Folders("test").Folders("subTest")
Set colRules = Application.Session.DefaultStore.GetRules()
Set oRule = colRules.Create("ruleTest", olRuleReceive)
Set oMoveRuleAction = oRule.Actions.MoveToFolder
With oMoveRuleAction
.Enabled = True
.Folder = oMoveTarget
End With
Set oExceptSubject = _
oRule.Conditions.BodyOrSubject
With oExceptSubject
.Enabled = True
.Text = Array("my keywords")
End with
colRules.Save
End Sub
But this script dont accept all my keywords, how can I add them in rule...