NoteItems of same name

Hi All,

I am trying to fetch the attachments by getting $FILE items in document.

Below code executes as expected in development environment.

ForAll itemTemp In doc.Items

If Ucase(itemTemp .Name) = "$FILE"  Then

  Set attachment = objDoc.GetAttachment(itemTemp.Values(0))

End If

End ForAll

However in production server; if there are multiples files in documents, it gets same file multiple times. Say there are three different files, it fetches the single file three times.

I am not sure why this happens only on production server, but I guess this something related to multivalued storage capacity of Lotus.

Please advise me how can I tackle this case?

Thanks in advance

Subject: Better way of retrieving attachments

Hello, Yog R. I think there is a better way of getting a handle to the attachments embeddeded in fields on a document. Why not use the EmbeddedObjects property of the NotesDocument class or NotesRichTextItem class and then check to see if the embedded object is an attachment? So your code might look like:

Set bodyrtitem = doc.GetFirstItem( “Body” )

If ( bodyrtitem.Type = RICHTEXT ) Then

Forall x In bodyrtitem.EmbeddedObjects

If ( x.Type = EMBED_ATTACHMENT ) Then

  'do whatever you need to do