Lotus Notes FAQ Visit Our Sponsor!

How do you check if a document is a deletion stub?

When you write an agent that works on New or Modified Documents, the UnprocessedDocuments collection will sometimes return a deletion stub instead of only returning documents (this is probably a bug, but it's been around since R4). If you do not program for this case, your agent may suddenly stop working because it tried to access an item on a document that has been deleted.

You can check if a document is a deletion stub with this:
If (doc.Size = 0) then
'doc is a deletion stub
Else
'doc is not a deletion stub
End If

You can also use a comparision of:
If (doc.NoteID = "")


Applies to Notes Versions: 4, 4.5, 4.6, 5
Last Modified: February 15, 2001