HiI want to remove all doc in aview there field orderOK is 0. I’m not use LS so often and is stuck here. Could anyone help me.
Sub Initialize
Dim session As New Notessession
Dim thisDb As NotesDatabase
Dim dc As NotesDocumentCollection
Dim v As NotesView
Dim doc As NotesDocument
Dim docStatus As NotesDocument
Dim profileDoc As Notesdocument
Dim Server As Variant
Dim DB As Variant
Dim collection As NotesDocumentCollection
Print "Delete document, Started at: " + Now
Set DB = session.CurrentDatabase
'Set Server = session.ServerName
'name$ = session.ServerName
Dim DBdoc As New NotesDatabase(Server(0), DB(0))
Set view = DB.GetView( "($All)" )
Set doc = view.GetFirstDocument
Set docStatus = session.DocumentContext
If(doc.orderOK(0)="0") Then
' Remove document
While Not doc Is Nothing
Set docNext = view.GetNextDocument(DBdoc)
Call doc.remove(True)
Set doc = docNext
Wend
End If
Print "Delete document, Finished at: " + Now
End Sub
Kind regards
Fredrik