RE: Get Value to Address Book document Scott Carpenter 9.Jan.04 04:31 PM a Web browser Domino Designer -- LotusScript 4.6.5aWindows NT
I have a lot of trouble following someone else's code, so it was faster for me to just sit down and quickly write an example. This isn't tested, so be aware there may be typos in it. It's just to give you an idea of what it would look like.
This code goes through a database filled with documents that have a field called EmployeeName. It takes the name stored in each document and adds that name to two groups on the server.
Sub Initialize
Dim s As New NotesSession
Dim thisdb As NotesDatabase
Dim pabdb As NotesDatabase
Dim pabview As NotesView
Dim thisview As NotesView
Dim empdoc As NotesDocument
Dim group1doc As NotesDocument
Dim group2doc As NotesDocument
Dim group1members As NotesItem
Dim group2members As NotesItem
Set thisdb = s.CurrentDatabase
Set pabdb = s.GetDatabase ( "Server01" , "names.nsf" )
Set thisview = thisdb.GetView ( "MyView" )
Set pabview = pabdb.GetView ( "Groups" )
Set group1doc = pabview.GetDocumentByKey ( "Group1" )
Set group2doc = pabview.GetDocumentByKey ( "Group2" )
Set group1members = group1doc.GetFirstItem ( "Members" )
Set group2members = group2doc.GetFirstItem ( "Members" )