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 Doc1 As NotesDocument
Set Doc1 = collect.GetFirstDocument
If Doc1.Form(0) = "Host" Then
Call workspace.ComposeDocument( "", "", "formname" )
Else
Msgbox "You did not select a valid Assignment 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
End Sub