|
|
You can use the FolderReferences property of a document to do this. This code will put all documents that have not been foldered into a new "Lost Documents" folder:
Sub Initialize
Dim sess As New NotesSession
Dim db As NotesDatabase
Set db = sess.CurrentDatabase
db.FolderReferencesEnabled = True
Dim coll As NotesDocumentCollection
Set coll = db.AllDocuments
Set doc = coll.GetFirstDocument
While Not(doc Is Nothing)
i = 0
If doc.FolderReferences(0) <> "" Then 'doc is in at least one folder, so pull it from this collection
Call coll.DeleteDocument(doc) 'just pulls it from the folder)
End If
Set doc = coll.GetNextDocument(doc)
Wend
Call coll.PutAllInFolder("Lost Documents") 'all those that remain in the collection
End Sub

Notes R4
Notes/Domino 4.5
Notes/Domino 4.6
Notes/Domino R5
Notes/Domino 6
Notes/Domino 6.5
Notes/Domino 7
Notes/Domino 8
Notes/Domino 8.5