Delete all documents of a View

Hello, an easy question.

How to delete all the documents of a view using lotusScript? I tried to do a while, but i can use de getNsxtDocument, because the document is deleted.

Thank you SO much.

Subject: Delete all documents of a View

Hi,

two concepts to do so:

  1. start at the bottom of the view

This means use getLastDocument and loop until no more docs are found

  1. use view.allEntries

Dim session As New NotesSession

Dim db As NotesDatabase

Dim view As NotesView

Dim vc As NotesViewEntryCollection

Set db = session.CurrentDatabase

Set view = db.GetView(“By Category”)

Set vc = view.AllEntries

Call vc.RemoveAll(True)

HTH

Subject: RE: Delete all documents of a View

Ruediger,

Thank you your script was very helpful!!

Wade

Subject: Delete all documents of a View

You are right… just use GetFirstDocument again. Since you delete the first document each time the next time you loop the Next document is the first. Don’t forget to refresh the view prior to grabbing the First document each time.

HTH.

Mark