This example displays the documents in the By Author view of a
database named ProgWork2 in a modal window then displays the Subject
items from the selected list. Sub Click(Source As Button)
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim item As NotesItem
Set db = session.CurrentDatabase
Set collection = workspace.PickListCollection( _
PICKLIST_CUSTOM, _
True, _
"snapper", _
"ProgWork2", _
"By Author", _
"My Dialog", _
"Please select a document or two." )
If collection.Count = 0 Then
Messagebox "User canceled" ,, _
"Subject item on the document(s)"
Else
Set doc = collection.GetFirstDocument
While Not ( doc Is Nothing )
Set item = doc.GetFirstItem( "Subject" )
If ( item Is Nothing ) Then
messagelist = messagelist & "None" & Chr(10)
Else
messagelist = messagelist & item.Text & Chr(10)
End If
Set doc = collection.GetNextDocument (doc)
Wend
Messagebox messagelist ,, _
"Subject item on the document(s)"
End If
End Sub