Sub Click(Source As Button)
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim collect As NotesDocumentCollection
Set collect = db.UnprocessedDocuments
If collect.count = 0 Then
Msgbox " No Document selected!", 0 + 16
Exit Sub
End If
If collect.count = 1 Then
Dim sdoc As NotesDocument
Set sdoc = collect.GetFirstDocument
If sdoc.Form(0) = "Lookup List" Then
Dim SourceFieldValues As Variant
SourceFieldValues = sdoc.GetItemValue("ListValues")
Dim doc As NotesDocument
For J = 0 To Ubound(SourceFieldValues)
Set doc = db.CreateDocument
doc.Form = "DLE"
doc.dl_category="Office"
doc.dl_entry = SourceFieldValues(J)
Call doc.Save(True, True)
Next J
Msgbox "Done!"
Else
Msgbox "You did not select a valid Lookup List document, please try again.", 0 + 16
End If
Else
Msgbox "You have selected more than one document, please correct and try again.", 0 + 16
End If
Call workspace.viewrefresh
End Sub