Having problem with NSFNoteDetachFile() function

When I use NSFNoteDetachFile() on a message that comes in from smtp it removes the attachment and $FILE field but leaves the embedded object in the body. When opening the message after the attachment is removed it looks like a 0 byte file and the notes client will give an error if you try to forward the message. How can I remove the embedded object which is in one of the body fields?

Thank you