DIIOP - Attachment files application

Hi folks,

I am developing a Notes interface using Java API distributed with Notes 6.0

I have got two problems that i would appreciate so much if you could give any

clue.

** I am trying to get a list of attachment files from a notes document, i have followed

the examples in the documentation:

RichTextItem it = (RichTextItem) doc.getFirstItem (“$FILE”);

But i got the following runtime exception:

Exception => lotus.domino.cso.Item

This error message does not give any clue…

** I am trying to get an attachment file with the following code:

EmbeddedObject em = doc.getAttachment((doc.getFirstItem (“$FILE”)).getValueString ());

em.extractFile (“c:\temp\” + em.getSource ());

When i am trying to extract an attach file, i got the following runtime exception:

Exception => null NOTES ID ERROR: 4038 NOTES NAME ERROR: The requested operation could not be completed

Many thanks,

Subject: DIIOP - Attachment files application

To first one, $FILE is not a rich text item. instead use :

Item it = doc.getFirstItem(“$FILE”) and process it.

Re the other one, is it possible that your session has timed out before the line that gets the extract file has been reached ?

Subject: Thanks, now i can get the names of the attachments but…

Thank you for your help…

Now, I can get the names of the attachments files but i can not get the attachment file due to the following error:

** I am trying to get an attachment file with the following code:

EmbeddedObject em = doc.getAttachment(sNameAttach);

em.extractFile (“c:\temp\” + em.getSource ());

When i am trying to extract an attach file, i got the following runtime exception:

Exception => null NOTES ID ERROR: 4038 NOTES NAME ERROR: The requested operation could not be completed

Do you have any idea for solving this problem??

Kind regards,

Subject: RE: Thanks, now i can get the names of the attachments but…

Sorry for the belated response. I have been away for some time due to other project requirements.

I have had this issue crop up on 2000/XP where you might not have OS level permissions to create files. You might want to try extracting to the NOtes Data directory or any other directory where you will have write permissions.

HTH

Sriram

Subject: DIIOP - Attachment files application

I would try to get the attachment names with session.evaluate({@attachmentnames}, doc ); and then do the embedded object.