« What's wrong with your eyes? | Main| Public Release: azlw Enhanced Log Version 2.01 Now available »

How I get an Empty NotesDocumentCollection

QuickImage Category Show-n-Tell Thursday Technical

Tomorrow is Thanksgiving here in the US, so I figured I'd post this one a day early. I also posted this as a response to Andre Guirard's Lotus Domino Designer wiki post: Create an empty NotesDocumentCollection. I've reposted it here primarily so that I can format it in a manner more pleasing to my eye. (I'm weird that way). Enjoy:

Public Function getEmptyDocumentCollection(source As NotesDatabase) As NotesDocumentCollection
%REM This function intentionally has NO ERROR TRAPPING. Errors must be handled by the calling code.
'/**
' * Creates an empty NotesDocumentCollection from the source database.
' *
' * @param source NotesDatabase from within which to create the empty document collection.
' * @return NotesDocumentCollection containing zero documents.
' */
%END REM

Dim result As NotesDocumentCollection

Set result = source.GetProfileDocCollection("*INVALID*")
While (result.Count > 0)
Call result.DeleteDocument(result.GetFirstDocument())
Wend ' (result.Count > 0)

Set getEmptyDocumentCollection = result

End Function ' getEmptyDocumentCollection

Comments

Gravatar Image1 - For those on Notes 8 who does not mind using undocumented features see this post on Nathans blog: { Link }

Gravatar Image2 - I'm firmly in the "DO NOT USE" undocumented features camp.


Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::banghead;:cool::cry::emb::grin::huh::laugh::lips::rolleyes::sniper:;-)

Search

Wowsers! A Tag Cloud!

Links

MiscLinks