Der Code ist in dem Click-Event einer Aktion enthalten, die zu einem View gehört.
Sub Click(Source As Button)
Dim coll As NotesDocumentCollection, _
ws As New NotesUIWorkspace, _
sourceview As NotesUIView, _
doc As NotesDocument, _
cnt As Double
Set sourceview = ws.CurrentView
Set coll = sourceview.Documents
Set doc = coll.GetFirstDocument
cnt = coll.Count
veri = Msgbox("Möchten Sie " + Cstr(cnt) + " Dokumente löschen?", 4 + 32, "Dokument löschen")
If veri <> 6 Then
continue = False
Exit Sub
End If
Set doc = coll.GetFirstDocument
Do While Not (doc Is Nothing)
Call doc.Remove(True)
Set doc = coll.GetNextDocument(doc)
Loop
Call ws.ViewRefresh
End Sub