Set collection = getMyCollection()
Function getMyCollection() As NotesDocumentCollection '(.........) Set getMyCollection = db.AllDocuments End Function