Generate txt file for iNotes migration

Share

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.

Sub
Initialize
       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
       nomedoarquivo$=“c:file.txt”
       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)
                       nome$=doc.GetItemValue(“Members”)(i)
                       Set docPerson=vis.GetDocumentByKey(nome$)
                       correio$=docPerson.mailfile(0)
                       Print #fileNum%,correio$        
               Next
               Set doc = dc.GetNextDocument(doc)
       Wend
       Close fileNum%
End
Sub