Domino Code Fragment

Code Name*
Agent to copy all documents from a Target Db to your Db
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.118.164.151
Description*
Copies all documents from another database to the current database
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Sub Initialize
    Dim session As New NotesSession
    Dim originalDb As NotesDatabase
    Set originalDb = session.CurrentDatabase
    Dim targetDb As New NotesDatabase( "", "test.nsf" )
    Dim collection As NotesDocumentCollection
    Dim doc As NotesDocument
    Set collection = targetDb.AllDocuments
    For j = 1 To collection.Count
         Set doc = collection.GetNthDocument( j )
         Call doc.CopyToDatabase( originalDb )
    Next
End Sub