... ITEM scheint nicht gesetzt zu sein.
ich hab das mal so gelöst:'-------- und jetzt die neuen erstellen
Set view = dbvon.getView("neue_docs")
Set doc = view.getfirstDocument
Do While Not doc Is Nothing
Set docNew = dbziel.createDocument
Call doc.CopyAllItems(docNew, True)
Call docNew.Save(True, True)
Set doc = view.getNextDocument(doc)
Loop
vielleicht hilft's.
... ich habe erbarmen:
Sub Initialize
Dim doc As NotesDocument
Dim docNew As NotesDocument
Dim docRemove As NotesDocument
Dim view As NotesView
Dim dbvon As NotesDatabase
Dim dbziel As NotesDatabase
Dim session As NotesSession
Dim viewneuedocs As notesview
Dim strServer As String
Dim zaehl1 As Integer
Dim zaehl2 As Integer
Set session = New NotesSession
Set dbvon = session.currentDatabase
strServer = dbvon.server
Set dbziel = session.GetDatabase(strServer , "xxx\yyy.nsf")
Set docNew = dbziel.createDocument
If Not dbziel.isOpen Then
strFehler = "Zieldatenbank : xxxx lässt sich nicht öffnen"
Exit Sub
End If
'-------- zuerst die alten documente löschen
zaehl1 = 0
Set viewneuedocs = dbziel.getview("neue_docs_aus_xxx")
Set docRemove = viewneuedocs.getfirstDocument
Do While Not docRemove Is Nothing
Call docRemove.Remove(True)
zaehl1 = zaehl1 + 1
Call viewneuedocs.refresh
Set docRemove = viewneuedocs.getfirstDocument
Loop
'-------- und jetzt die neuen erstellen
zaehl2 = 0
Set view = dbvon.getView("neue_docs")
Set doc = view.getfirstDocument
Do While Not doc Is Nothing
Set docNew = dbziel.createDocument
Call doc.CopyAllItems(docNew, True)
docNew.neu = "1"
Call docNew.Save(True, True)
zaehl2 = zaehl2 + 1
Set doc = view.getNextDocument(doc)
Loop
'------------------------------------------------------------
' protokoll erstellen
Dim docProtokoll As NotesDocument
Dim rtitem As NotesRichTextitem
Dim agent As NotesAgent
Dim dateTime As New NotesDateTime( "" )
Dim varDummy As Variant
Set agent = session.CurrentAgent
Set docProtokoll = dbvon.createDocument
docProtokoll.form = "protokoll"
docProtokoll.name = agent.Name
Call dateTime.SetNow
'Set docProtokoll.datum_agent = dateTime
Set rtitem = New NotesRichTextItem (docProtokoll, "protokoll")
Call rtitem.AppendText( "Anzahl Dokumente gelöscht :" + Cstr(zaehl1))
Call rtitem.AddNewLine( 1 )
Call rtitem.AppendText( "Anzahl Dokumente neu :" + Cstr(zaehl2))
varDummy = docProtokoll.ComputeWithForm( False, False )
Call docProtokoll.Save( False, True )
End Sub
die namen müssten angepasst werden.