Lotus Notes — рабочий инструмент программиста.

Обсуждения программирования на Lotus Notes/Domino

Export all group members in CSV file

leave a comment »

Dim FileNum As Long
Dim LogError As String Sub Initialize Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments Set doc = collection.GetFirstDocument()
While Not(doc Is Nothing) Call InitExport( Doc.ListName(0) )
Call GroupExport( Doc.ListName(0) )
Call TerminateExport( ) Set doc = collection.GetNextDocument(doc)
Wend
print LogError
End Sub Sub TerminateExport( ) Close #FileNum End Sub Sub GroupExport( GroupName As String ) Dim Session As New NotesSession
Dim DB As NotesDatabase
Set DB = Session.CurrentDatabase Dim AllUsersView As NotesView
Set AllUsersView = DB.GetView( "($Users)" ) Dim Doc As NotesDocument
Set Doc = AllUsersView.GetDocumentByKey( GroupName , True ) If Doc Is Nothing Then
LogError = LogError + " Groupe/User introuvable : " + GroupName + Chr$(10)
Exit Sub
End If If Doc.Type(0) = "Group" Then Forall OneMember In Doc.Members
GroupExport( OneMember )
End Forall Elseif Doc.Type(0) = "Person" Then Print #FileNum, |"| + Doc.FullName(0) + |"| End If End Sub Sub InitExport( GroupName As String ) FileNum = Freefile() Open "c:\TEMP\Export CSV of " + GroupName + ".CSV" For Output Access Write As FileNum End Sub

Original source : http://www.openntf.org/projects/codebin/codebin.ns…

Написано lotusnotes

Октябрь 12, 2008 в 9:33

Опубликовано в Lotus Notes

Ответить

Для отправки комментария вы должны авторизоваться.