Document Collection Deleteion

When I delete a document from a collection what happens with reference to navigating through a collection. I have a collection of documents which I am processing so that if I delete a response I want to check wether that documents parent is in the collection. And if it is I want to remove and then process the next document in the collection

Subject: Document Collection Deleteion

The issue is with the loop, because if you delete the document from the collection then try and get the next document, referring to the doc that’s been deleted you’ll get an error.

So, set the next doc before processing the initial doc (using a do loop, yours may be different of course):

do until doc is nothing

set doc2 = doccol.getnextdocument(doc)

process and delete doc

set doc = doc2

Loop

hth

Dan

Subject: Document Collection Deleteion

as variant, using GetNthDocument

for i=1 to dc.count

set doc = dc.GetNthDocument(i)

'…

'delete doc

'…

next

Subject: Document Collection Deleteion

DOH…

Subject: Document Collection Deleteion

make an empty colection object called DeleteThese

everytime a document qualifies to be deleted, move it to the DeleteThese collection

at the end run the delete method on this collection object