warum bitte bringt mir Set NewDoc = Doc.CopyToDatabase(ZielDB) den fehler “Error 4207: Function requires a valid ADT argument???
Function CopyAllDocs(qserver As String, qdb As String, zpath As String, qview As String) As Integer
On Error Goto ErrHand
'-1 = error
'>0 = ok
Dim QuellDB As NotesDatabase
Dim QuellView As NotesView
Dim ZielDB As NotesDatabase
Dim Session As New NotesSession
Dim vc As NotesViewEntryCollection
Dim entry As NotesViewEntry
Dim Doc As NotesDocument
Dim NewDoc As NotesDocument
Dim f As Long
Dim ActDB As Integer
CopyAllDocs = -1
Set QuellDB = Session.GetDatabase(qserver, qdb, False )
QuellDB.FolderReferencesEnabled = True
Set QuellView = QuellDB.GetView(qView)
Set vc = quellview.AllEntries
Set entry = vc.GetFirstEntry()
Set Doc = entry.Document
ActDB = 0
Set ZielDB = Session.GetDatabase(qserver,Cstr(ActDB)+"_"+qdb, False)
For f = 1 To vc.Count
If f = DBSchnittmarken(ActDB) Then
Call WriteLog("Wechsle zu Ziel-DB Nr: " & Cstr(ActDB), Info)
Print "Wechsle zu Ziel-DB Nr: " & Cstr(ActDB)
ActDB = ActDB + 1
Set ZielDB = Session.GetDatabase(qserver,Cstr(ActDB)+"_"+qdb, False)
End If
Set entry = vc.GetNthEntry(f)
Set Doc = entry.Document
Set NewDoc = Doc.CopyToDatabase(ZielDB)
Forall ActFolder In doc.FolderReferences
Call NewDoc.PutInFolder(ActFolder,True)
End Forall
Next
CopyAllDocs=1
Exit Function
ErrHand:
Call ErrHandSub()
Resume Next
End Function
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.