C API copy Attachment

Hi,

I’m trying to use the c api to basically totally copy an email (and re send it). I can create a new note, and append all items etc, so i can open it in note. Only problem is when i try to open or view or save the an attachment that i’ve ‘copied’ i get an error message “invalid or non existent document, cannot save file to …”

I dont get it! when i look at the properties of the $file field they’re identical to the properties of the one in the original document (except they have an new OBJECT ID). I’m stumped. I dont want to detach and reattach (that wont work for the ultimate thing i’m trying to do)

Any help would be smeggin’ awesome, cause i’m going insane!

thanks in advance

S

Subject: C API copy Attachment

Not sure whether it will help, but in ND6 and above, you can use NSFNoteExtractWithCallback to retrieve the attachment in memeory, and then create a new attachment using the sequence of NSFDbAllocObject, NSFDbAppendObject, NSFDbWriteObject, all without detaching or attaching, or at least without needing to touch the hard drive.