Wednesday, December 23, 2009

Delete all profile documents in a database

'**********************************************************************************'@Author : Karthikeyan A
'@Purpose : delete all profile documents in the mentioned database
'@Type : Function
'@Name : deleteAllProfileDocsInGivenDatabase
'@Param : db As NotesDatabase
'@Return : Boolean (True indicates success and False otherwise)
'**********************************************************************************

Function deleteAllProfileDocsInGivenDatabase(db As NotesDatabase) As Boolean
'mark the flow of control getting inside the current function
deleteAllProfileDocsInGivenDatabase=False

Dim profileDocCollection As NotesDocumentCollection

'if the provided database does not exist then return false and exit
If Not db.isOpen then
set deleteAllProfileDocsInGivenDatabase=false
Exit function
End If

'set the handle for the set the profile documents in the database
Set profileDocCollection=db.GetProfileDocCollection

'delete all the profile documents
Call profileDocCollection.RemoveAll(True)

'mark the flow of control getting out of the current function
deleteAllProfileDocsInGivenDatabase=True
End Function

No comments:

Post a Comment