Examples: Clear method (NotesView - LotusScript®)

This script performs a full-text search on a view. While the view is filtered with the results of the full-text search, the script puts all the documents in the view (those documents that match the search) into a folder. The script then clears the full-text search, and places all the documents in the view (including those documents that matched the search and those that did not) into another folder. The result:

  • All documents in the Transportation view that contain the word "bicycle" are placed into the Two-wheeled vehicles folder.
  • All documents in the Transportation view, including those that contain the word "bicycle," are placed into the Vehicles folder.
Dim folderName As String
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set view = db.GetView( "Transportation" )
Call view.FTSearch( "bicycle", 0 )
' view is filtered
Set doc = view.GetFirstDocument
While Not ( doc Is Nothing )
  Call doc.PutInFolder( "Two-wheeled vehicles" )
  Set doc = view.GetNextDocument( doc )
Wend
' clear the full-text search
Call view.Clear
' view is no longer filtered
' view methods now operate on all documents in view
' move all documents to different folder
Set doc = view.GetFirstDocument
While Not ( doc Is Nothing )
  Call doc.PutInFolder( "Vehicles" )
  Set doc = view.GetNextDocument( doc )
Wend