Get attachment from child

I need to send an email and attach on the email, a file that is in a response document.What is the correct procedure?

Read all responses and find the parent and using “GetDocumentByUNID” compare it with my uidoc and if it’s the same do “AppendRTItem”?

I ready need some advise.

Subject: Get attachment from child

Can you expand on what you are trying to do. Are you sending the email from the main document and if so is there only one response document? If there is more than one response document what is the criteria for finding the response document where the file is held?

Subject: RE: Get attachment from child

you may use Responses property of NotesDocument class to loop thru all the response documents.

Subject: RE: Get attachment from child

I’m sending the email from the main document, and I will need to get two types of attachments in two different steps of the process. I’m thinking of using a different response form with diffferent field names in the attachments.The user that is pressing the button to generate the email, does not have access to the attachments, that why I had to put the attachments in a response document to don’t allow view access.

Subject: RE: Get attachment from child

You can use the notesdocument responses property to get a collection of response documents to the main document but I don’t see why you are allowing someone to send attachments that you do not want them to read.

If the response document with the attachment has a readers field that prevents someone from accessing it then they will not be able to access it in script either. You can restrict access to a view containing the response documents but this is not proper security as someone with knowledge will be able to get around this.

You can use the notesrichtextitem class to copy the attachment from the document to the email.