Habs nicht getestet, könnte aber klappen
Sub Initialize
On Error Goto Fehler
Dim s As New notessession
Dim db As NotesDatabase
Dim vw As NotesView
Dim col As NotesDocumentCollection
Dim doc As NotesDocument
Dim searchVal As String
Dim index As Variant
dim counter as long
searchVal = "WG1"
counter = 0
Set db = s.currentDatabase
Set vw = db.getView("HIER_DEN_VIEW_NAMEN_REINSCHRIBEN")
Set col = vw.getAllDocumentsByKey("RandomKey den es bestimmt nicht gibt") ' diese Zeile nicht ändern :-)
Set doc = vw.getFirstDocument()
Do Until doc Is Nothing
col.addDocument doc
Set doc = vw.getNextDocument(doc)
Loop
Set doc = col.getFirstDocument
Do Until doc Is Nothing
index = Arraygetindex(doc.getItemValue("Feld1"), searchVal)
If index <> Null Then
doc.replaceItemValue "Feld2", doc.getItemValue("Feld1")
doc.save True, False
counter = counter + 1
End If
Set doc = col.getNextDocument(doc)
Loop
msgbox Cstr(counter) & " documents have been changed by this friendly agent."
Ende:
Exit Sub
Fehler:
Msgbox "Fehler -> " & Error$ & "(" & Cstr(Err) & ") in Zeile: " & Cstr(Erl)
Resume ende
End Sub