Das Notes Forum

Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: Steffen_Albrecht am 22.01.03 - 09:29:25

Titel: Dokumente aus anderer DB heraus kopieren
Beitrag von: Steffen_Albrecht am 22.01.03 - 09:29:25
Hallo,

ich habe zwei Datenbanken A und B.
Ich befinde mich einer Maske von Datenbank A, wähle
nun aus einer Ansicht von Datenbank B per @Picklist
einige Dokumente aus.
Danach soll auf Knopfdruck eine Kopie von jedem ausgewählten
Dokument in Datenbank A angelegt werden.

Jetzt meine Frage:
Hat jemand eine Idee wie das Script oder die Formel hinter
dem Button zum Kopieren der Dokumente aussehen muss?

Gruß
    Steffen
Titel: Re:Dokumente aus anderer DB heraus kopieren
Beitrag von: Rob Green am 22.01.03 - 09:40:36
auszug aus Help:

Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Set db=session.CurrentDatabase
'Launches a modal window dispaying all of the documents in the By Author 'view of the database Zippy
Set collection = workspace.PickListCollection(1, True, _
       "ZippyServer","Zippy","By Author","My Dialog", _
       "Please select a document or two.")
'The following line puts the selected documents in a folder called My 'Folder. The value True means that a folder will be created if one does not 'already exist.
Call collection.PutAllInFolder("My Folder",True)

statt call collection.putallinfolder machste Du ne Schleife nach "Set collection=" mit:

Dim doc as notesdocument
Set doc = collection.GetFirstDocument
While Not(doc Is Nothing)
Call doc.Copytodatabase(db)
Set doc = collection.GetNextDocument(doc)
Wend

Müßte so klappen.