I am using Notes 8.5 and trying to run an agent that uses the C API. The function I am using is as follows:status = NSFNoteDeleteExtended(hDb, 40790, UPDATE_NOSTUB). I always get the error 540 which is This function is inappropriate for filesystem directories. I have also tried this with NSFNoteOpen and got the same 540 error. The notes id is a valid noteid converted from a hex value to a long. Any ideas?