Get empty NotesDocumentCollection-Object


%REM
    Function getEmptyDocumentCollection
    Description: Returns an empty document collection
    Created Nov 28, 2011 by Sven Hasselbach
%END REM
Function getEmptyDocumentCollection() As NotesDocumentCollection
   On Error GoTo errH
   
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim dc As NotesDocumentCollection
    
   Set db = session.Currentdatabase
   Set dc = db.Alldocuments
   dc.Subtract db.Alldocuments
   Set getEmptyDocumentCollection = dc
    
the_end:
   Exit Function

errH:
   Print "getEmptyDocumentCollection() - Error #" & Err & ": '" & Error & "' @ Line " & Erl
   Resume the_end

End Function
All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.
2 comment(s)Login first to comment...
jeniffer homes
(at 01:51 on 22.07.2016)
Consider this just a basic framework for putting all your validation in one place.
Glen P Urban
(at 07:43 on 16.10.2013)
If you are using R8 or above you can use:
NotesDatabase.CreateDocumentCollection