Handle multiple field with same name

When we receive Internet email in Lotus Notes client, there would be more than one field named “received” in the document properties. We would like to modify the email template to check the contents of the “received” fields. I have used @GetField, but it returns only the first “received” field value.

Please help to find a way to retrieve the contents of all “received” fields of an email. Thanks.

Subject: Only way I know…

I had that same issue back in 2000 or 2001, when I wrote a spam filter/DNSBL lookup functionality for Notes R5 for my work.

The only way I know to do that is to read the first field (using GetFirstItem), remove it, read the next field, remove it, etc.

You have to use the Remove method of the NotesItem class to do that.

This is from the online help:

“If multiple items in a document have the same name, programmatic access is limited to the first item. The remaining items yield invalid data. A work-around is to get the first item, process it, remove it, again get the first item (which was the second item), and so on until you process all the items with the same name. If you do not save the document, the items are not actually removed.”