SnTT.gifI needed to loop over all profile documents to update some stuff. LotusScript has a nice method for this, called GetProfileDocCollection.
This is how you use it:

...
Set dc = db.GetProfileDocCollection("Profile")
'I only need profile documents called 'Profile'
I skip the obvious initial Dim's and Set's, as we all know them.
This works fine most of the time. However, if there are too many profile documents, you get the following 'self-explaining :-)' error message:
"Profile document enumeration pool is full".
Some Googling reveals this Technote. With the following remark: "This problem was reported to Quality Engineering and determined to be a software limitation." Duh ?
They offer a workaround too, but this is complete BS.

Olga Babushkina offered me a great solution, by using CreateNoteCollection. I've never had any use for this function, but I can see it's power.
Here's how to use it:
Dim nc As NotesNoteCollection
Dim noteID As String
Dim doc As NotesDocument
... 'other dim's and set's here

Set nc = db.CreateNoteCollection(False) 'this creates an empty collection of noteIDs
nc.SelectProfiles = True 'we only need profile documents
Call nc.BuildCollection 'execute the building of the notecollection
If nc.Count = 0 Then Exit Function 'bail out if nothing found

noteID = nc.GetFirstNoteId 'get the first noteid
While noteID<>""
Set doc = db.GetDocumentByID (noteID) 'now get the doc itself
If doc.form(0) = "Profile" Then 'I only want to find the profile documents called 'Profile'
'do some stuff here
End If
noteID = nc.GetNextNoteId(noteID) 'get the next noteid
Wend

Using this allowed me to have access to over 7000 profile documents.
Thanks Olga, a lifesaver !

Category:  Domino  Notes  Show-n-Tell Thursday  SnTT  | TechnoratiTechnorati: , , ,