Document collection problem in Querydocumentdelete event

Hi

I hace a problem. I have a code in Querydocumentdelete event, because I need to modify a document field value from a Current View (NotesUIView). Well, I wrote my code, and worked fine, but now it doesn´t works. I have saw that my

problem is with Document Collection, because it doesn´t have nothing (zero documents), but I am selecting documents

in my View. This my Code:

Set uiview = wks.CurrentView

Set view = uiview.View

Set dc = uiview.Documents

Msgbox(Cstr(dc.Count))

Msgbox(view.Name)

Set doc = dc.GetFirstDocument

While Not(doc Is Nothing)

doc.Borra = "B"

Call doc.Save( False, True )

Set doc = dc.GetNextDocument(doc)

Wend

Call wks.ViewRebuild

Message box send me first “0”, and view.name is right, I don´t know what´s the problem.

Some body can help me please, Thanks in advance.

Subject: Document collection problem in Querydocumentdelete event

When you have such script in “Querydocumentdelete” event which is the Database script event, then you need to get the collection using uidb property as:

Set col = Source.Documents

where Source is NotesUIDatabase (parsed parameter)

This collection is the documents that you are currently working on or selected in a view.

Subject: RE: Document collection problem in Querydocumentdelete event

Thanks a lot Narasimhan, now it works fine.

Regards.