Tuesday, July 22, 2008

How to initialize NotesDocumentCollection in zero

Sometimes I have tasks where I should start to work with empty collection of documents. One of my fellow shown me yesterday probably the simplest solutions how we can got empty collection.

Set notesDocumentCollection = notesDatabase.GetProfileDocCollection("WRONG_NAME")

I like this solution and as I see it is perhaps the best one.

p.s. if anybody has better solution I would be happy to see it.


Anonymous said...

You are doing it the best way...


Spanky said...

That is how I do it as well. However, because you can never truly be certain that WRONG_NAME hasn't been used to create a profile document in the past, it is always a good idea to test for the existence of docs in the collection (profileDocCollection.Count > 0). If the collection has entries, it is a simple matter to remove them.


Anonymous said...

isnt it from now on something with db.notesdocumentcollection?

Dmytro said...

sorry, what do you mean?

Unknown said...

There is a new method in Notes 8.


I think this is what quintessens was referring to.