Link to home
Start Free TrialLog in
Avatar of Jamie_Steele
Jamie_Steele

asked on

Extract Received fields from memo document via LotusScript

Hi there

On the face of it, this is a simple question. But the answer remains elusive!

I want to export the contents of a memo document (from a users email database) in order to keep it as raw data. (Actually, the message is an annoying spam/virus that I want to submit to our spam preventor service.)

Using a script along the lines of:

'nDoc is a NotesDocument item, containing a typical memo
'WriteNode simply outputs to a text file

Forall o In nDoc.Items
  Forall i In o.Values
    Call WriteNode(o.Name, i, iFile)
  End Forall
End Forall

The idea being to scan through all fields on the document, and save each value found as an entry. So I can then provide the headers, etc for analysis.

I have found that when examining the Received field, I have 3 to 5 entries named Received typically. But each iteration of the loop always returns the first item. (i.e. item at index 0 is always returned.) You can see the multiple entries looking at the Document Properties box, and scanning down the list. You'll also find multiple Body fields.

The result being that I find 3 to 5 identical entries for the Received item.

Any ideas? Thanks - Jamie

Avatar of madheeswar
madheeswar
Flag of Singapore image

for spam u can use kspam from openntf.org

or use anti spam like trend micro to block mails which are spam or virus mails.
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jamie_Steele
Jamie_Steele

ASKER

Zvonko is absolutely correct. (Thanks for the simplicity!) I will give him the points for that solution.

The problem is still relevant. I may ask it again, in a different context.
Thanks for points.
In R6, the idiot who was asked to support this wrote a method for NotesItem taht works ONLY on received fields.

You can do it by DELETEING each item as you retrieve it.  Of course, you definitely do NOT want to save after doing so!  Which also means, you don't want to do it if the UI copy of the doc is open.  So, check isUiOpen.