Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
Information Mgmt
New to Lotus
How to buy
Live demos
Technical library
Forums & community
Java™ technology
Open source
SOA and Web services
Web development
My developerWorks
About dW
Submit content

developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum



PreviousPrevious NextNext

Mail Rules - Script to clear and disable mail rules in the mailbox
Beau Green 27.Jan.04 10:43 PM a Web browser
General 6.5 Windows 2000

Use this script to remove any $FilterFormula_xx information from the Calendar Profile. We added an Agent to our mail template. The user can then pick this from the actions menu.

Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.currentdatabase
Dim workspace As New NotesUIWorkspace

'This folder contains all the Mail Rules.
Dim folder As NotesView
Set folder = db.GetView("(Rules)")

'Find the calendar profile document in the current database. (GetProfileDocument will create the named profile document if it does not already exist.)
Dim calendarProfile As NotesDocument
Set calendarProfile = db.GetProfileDocument( "CalendarProfile" )

'Mail Rules are compiled and saved in special fields named $FilterFormula_xx
'Remove all of these fields from the calendar profile.
Forall item In calendarProfile.Items
If( Lcase$(Left$(item.Name,15)) = "$filterformula_" ) Then
Print "Cleanup " & item.Name
Call item.Remove
End If
End Forall

'Save changes to the calendar profile.
Call calendarProfile.Save( False, False )

'Disable all Rules.
Dim mailrule As NotesDocument
Set mailrule = folder.GetFirstDocument
While Not( mailrule Is Nothing )
Call mailrule.ReplaceItemValue( "Enable","0" )
Call mailrule.Save( True,False,True )

Set mailrule = folder.GetNextDocument( mailrule )

'Open the Rules folder
Call workspace.OpenDatabase( db.Server, db.FilePath, "(Rules)" )

'Message to the user.
Messagebox "Cleanup complete."

SOLUTION: Mail Rules & "Monitor can... (James W. Stuart... 27.Jan.04)
. . Before you delete a Rule, you must ... (Bill Ernest 27.Jan.04)
. . . . Spoke too soon... (James W. Stuart... 27.Jan.04)
. . That was not the solution, but this... (James W. Stuart... 27.Jan.04)
. . . . Mail Rules - Script to clear and di... (Beau Green 27.Jan.04)

Document Options

  Document options
Print this pagePrint this page

Search this forum

Forum views and search

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Advanced search

Member Tools

RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds


Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds


IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite