Sub Test()
Outlook.Session.DefaultStore.GetRules.Remove ("Close")
End Sub
我想念什么?上面没有删除具有该名称的规则。
答案 0 :(得分:0)
请参见下面的示例代码:
...
...
'Get Rules from Session.DefaultStore object
Set colRules = Application.Session.DefaultStore.GetRules()
'Loop through all rules
For i = colRules.Count To 1 Step -1
'Look for oRuleName
If colRules.Item(i).Name = oRuleName Then
'If oRuleName found, remove oRuleName rule and save rules
colRules.Remove (oRuleName)
colRules.Save '''''Important'''''
GoTo Continue 'Once oRuleName found, removed and rules saved, jump to Continue
End If
Next
找到参考链接here