Dim session As New notessession
Dim db As notesdatabase
Set db = session.currentdatabase
Dim collect As notesdocumentcollection
Set collect = db.unprocesseddocuments
If collect.count = 0 Then Exit Sub
If collect.count <> 2 Then
Msgbox "you must select 2 records only."
End If
Dim doc As notesdocument
Dim pdoc As notesdocument
Dim cdoc As notesdocument
Set doc = collect.getfirstdocument
Do
If doc.form(0) = "UP" Then
Set pdoc = doc
Elseif doc.form(0) = "DBAP" Then
Set cdoc = doc
End If
Set doc = collect.getnextdocument(doc)
Loop Until doc Is Nothing
If pdoc Is Nothing Then Exit Sub
If cdoc Is Nothing Then Exit Sub
If pdoc.up_uniqueID(0) = cdoc.up_uniqueID(0) Then
Call cdoc.MakeResponse( pdoc )
Call cdoc.save(True,True)
Print "Successfully matched. " + Now
End If