Hi All,I want to delete rules from user mail file, but not all, only if they are ‘send Full Copy to’
I am using the below code to delete it, but the rule doesn’t get disable, the rule is still working even I removed it.
My Code :
'****************************************************************************************************************
Option Public
Sub Initialize
On Error GoTo errHandler
Dim s As New NotesSession
Dim db As NotesDatabase
Dim rulesfolder As NotesView
Dim rules As NotesViewEntryCollection
Dim rule As NotesViewEntry
Dim ruledoc As NotesDocument
Dim profile As NotesDocument
Dim ctr As Integer
Set db=s.currentdatabase
Set rulesfolder=db.getview("Rules")
Set rules=rulesfolder.allentries
Set rule=rules.getfirstentry
While Not rule Is Nothing
Set ruledoc=rule.document
Action = ruledoc.ActionList(0)
If Left$(Action,18) = " send Full Copy to" Then
Call ruledoc.remove(true)
End If
Set rule=rules.getnextentry(rule)
Wend
errHandler:
MsgBox "Error on Line : " + CStr(Erl) + Chr(10) + "Error Code : " + CStr(Err) + Chr(10) + "Error : " + CStr(Error)
End Sub
'******************************************************************************************************************
Please help me how can I remove it from DB.
Thanks in Advance