DEselect items in a view with script?

I have a script that changes the status of selected documents (Set collection = db.UnprocessedDocuments) in a view. When the status changes these documents fall out of the view due to the view selection formula (which is fine.)

However, if the user runs the view action again it tries to act on those same documents. It APPEARS that they are still selected. I have a check “if collection.count=0 then Exit Sub” but it DOES run and complains they are not in the correct status for the action.

Can we programatically DEselect those documents? They are no longer in the current view and users can’t figure out whats going on.

Subject: DEselect items in a view with script?

Brian, have you tried the Deselectall method of the NotesUIView class? That might do it.

Subject: RE: DEselect items in a view with script?

That looks very promising. Thanks Jerry!