Domino Code Fragment

Code Name*
Agent to change $Ref to new parent document
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.133.108.241
Description*
Takes a given document ID and makes all selected documents responses to that document.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Sub Initialize
    Dim session As New NotesSession  'Declare session as a new Notes session
    Dim db As NotesDatabase
    Set db = session.CurrentDatabase
    Dim parent As NotesDocument
    Dim doc As NotesDocument
    Dim collection As NotesDocumentCollection
    Set collection = db.UnprocessedDocuments
    For i = 1 To collection.Count
         Set doc = collection.GetNthDocument( i )
         If doc.HasItem( "$Ref" ) Then
              Set parent = db.GetDocumentByUNID( "3F9C483C2D973485852566D6005F20BF")
              Call doc.MakeResponse( parent )
              Call doc.Save( True, True )
         End If
    Next i      
End Sub