Hi all,
I have a Field which will have a list of names.
I want to get the first name and get the servername & mailfile for this name.
Run some code using these values. Then get the next name in field and perform the same until nothing.
I can only find references to view collections, I cannot seem to run a loop on multiple values in a field.
Any help would be appriciated.
Paul
Sample code which may give an idea on what I am trying to achieve.
Sub Click(Source As Button)
'Set Dimensions
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim doc2 As NotesDocument
Dim item As NotesItem
'Get Current Document to work on
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
'Save current document
Call uidoc.Save
'Get database to create mini-doc in
'name1 = Get 1st name in AlarmList Field
'If Nothing Then
'Call uidoc.Close
'Else
'Server = @If(@IsError(@DbLookup("":"NoCache";"":"names.nsf";"($Users)";@Name([Abbreviate];name1);"MailServer"));"";@DbLookup("":"NoCache";"":"names.nsf";"($Users)";@Name([Abbreviate];name1);"MailServer"))
'mailfile = @If(@IsError(@DbLookup("":"NoCache";"":"names.nsf";"($Users)";name1;"MailFile"));"";@DbLookup("":"NoCache";"":"names.nsf";"($Users)";name1;"MailFile"))
'Set db = session.Getdatabase ( server , mailfile)
'Create mini-doc
Set doc2 = New NotesDocument(db)
Set item = doc.GetFirstItem("$Alarm")
Call item.CopyItemToDocument(doc2, "$Alarm")
Set item = doc.GetFirstItem("$AlarmOffset")
Call item.CopyItemToDocument(doc2, "$AlarmOffset")
Set item = doc.GetFirstItem("CalendarDateTime")
Call item.CopyItemToDocument(doc2, "CalendarDateTime")
Set item = doc.GetFirstItem("Subject")
Call item.CopyItemToDocument(doc2, "Subject")
'Save and move mini-doc to folder
Call doc2.Save(True , False , True)
Call doc2.PutInFolder ("($Alarms)")
'Close original document
Call uidoc.Close
End Sub