Generate txt file for iNotes migration

The agent bellow will be used to make a txt file with the mail files for migration. We select a group of users and then export  the mail files path to a txt file.
The txt file will be used with load convert -f .

Just put the agent on the Names.nsf.

       Dim ses As New NotesSession        
       Dim db As NotesDatabase
       Dim doc As NotesDocument
       Dim docPerson As NotesDocument
       Dim dc As NotesDocumentCollection
       Dim item As NotesItem
       Dim valores As Variant
       Dim vis As NotesView
       'variáveis para serem trocadas caso a caso
       Set db = ses.CurrentDatabase
       Set vis = db.GetView("($Users)")        
       'colocar o nome do grupo desejado
       searchFormula$ = {Form = "Group" & ListName=""}
       Set dc = db.Search(searchFormula$, Nothing,0)
       Set doc = dc.GetFirstDocument()
       fileNum% = Freefile()
       fileName$ = nomedoarquivo$
       Open fileName$ For Output As fileNum%        
       'Navega na coleção de grupos
       While Not(doc Is Nothing)
               'seleciona membros do grupo
               valores = doc.GetItemValue("Members")
               For i = 0 To Ubound(valores)
                       Set docPerson=vis.GetDocumentByKey(nome$)
                       Print #fileNum%,correio$        
               Set doc = dc.GetNextDocument(doc)
       Close fileNum%