Examples: EnableFolder method

This code moves all the documents in the collection that contain the word cayenne to the "Spicy" folder. The call to the EnableFolder method ensures that the "Spicy" folder exists; if it does not, this method creates it.

Sub Initialize
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Dim dc As NotesDocumentCollection
  Dim doc As NotesDocument
  Set db = session.CurrentDatabase
  Set dc = db.FTSearch("cayenne",20)
  Set doc = dc.GetFirstDocument
  Call db.EnableFolder("Spicy")
  While Not(doc Is Nothing)
    Call doc.PutInFolder("Spicy", False)
    Set doc = dc.GetNextDocument(doc)
  Wend
End Sub