Checking groups usin LotusScript

Often occurs with the removal of a user and her name stay in groups.
I created a simple agent to list groups with this kind of member.
The abent above is simple and can be improved.

Sub Initialize
        Dim db As NotesDatabase
        Dim doc As NotesDocument
        Dim docUser As NotesDocument
        Dim viewGroup As NotesView
        Dim viewPeople As Notesview
        Dim ses As New NotesSession
        Dim members As NotesItem
        Dim UserName As NotesName
        Dim fileNum As Integer
        Dim fileName As String
        Set db = ses.currentdatabase
        Set viewGroup = db.getview("$VIMGroups")
        Set viewPeople = db.getview("$VIMPeople")
        Set doc = viewGroup.getfirstdocument
        fileNum% = FreeFile()
        fileName$ = "c:group.txt"
        Open fileName$ For Output As fileNum%
        While Not doc Is Nothing
                        If doc.members(0)<>""  then
                        Set members = doc.getfirstitem("members")
                        ForAll v In members.Values
                                Set UserName = New NotesName( v)
                                Set docuser  = viewpeople.getdocumentbykey(username.abbreviated,True)
                                if docuser Is Nothing then
                                        Print #fileNum%,UserName.Abbreviated & "," & doc.ListName(0)
                                End if                                
                        End ForAll
                        End if
                Set doc = viewGroup.getnextdocument(doc)                
        Close fileNum%
End Sub

Searching for detais about an adminp process api documentation, i found an article on DeveloperWorks about a more improved tool to manage groups. I don't have time to test or learn the functions but the article is here. The code of this article was on the dead SandBox, but you can search and download using this link