Search Body field (rich text) of all email files

I need to search the Body field of all mail files on a server for a specific phrase. I have searched the forum, but haven’t really found the answer I’m looking for. Instr isn’t an option b/c I’d have to add a field to the template and then refresh the documents, thus updating the document – for legal reasons, I can’t do this. The mail files are not full text indexed and when I try to use FTSearch, I get a memory error.

Other than searching each db individually, what can I do? Is there any LotusScript I can use? Third Party products? I’m at a loss.

Subject: Search Body field (rich text) of all email files

You could use our Midas Rich Text LSX. You would have to write a short script, but it should be pretty straightforward and quite fast. I guess I am not clear why you could not use Instr on the text of the Body though, even without adding a field to the template.

Let me know if you would like to see the code you would need to do this with Midas.

Subject: Will this help?

This Lotus Script code will run through a rich text fieldand search for a specific character or character code, and

replace it with another, or remove it. It can then either

replace the text back into the rich text field or place it

into a regular text field, which in turn converts it to

text.

The code below replaces all of the chr(13) and chr(10)'s,

which represent a carriage return in rich text, with an html

BR tag, then places it all into a text field.

NOTE: For this code to work the document must first be

saved.

Dim db As Notesdatabase

Dim session As New notessession

Dim rtitem As Variant

Dim doc As Notesdocument

Set db = session.CurrentDatabase

Set doc = session.documentContext

Set rtitem=doc.getfirstitem(“Body”) 'Rich text field (Body)

'This takes out all of the chr(10)s

SourceS=rtitem.text

SearchS=Chr(10) 'String to search for

ReplaceS = “” 'String to replace with

While Instr(SourceS, SearchS) > 0

SourceS = Left$(SourceS, Instr(SourceS, SearchS) - 1) +

ReplaceS + Right$(SourceS, Len(SourceS) - Instr(SourceS,

SearchS) - Len(SearchS) +1)

Wend

'This replaces the chr(13) with the BR tag

SearchS=Chr(13) 'String to search for

ReplaceS = “
” 'String to replace with

While Instr(SourceS, SearchS) > 0

SourceS = Left$(SourceS, Instr(SourceS, SearchS) - 1) +

ReplaceS + Right$(SourceS, Len(SourceS) - Instr(SourceS,

SearchS) - Len(SearchS) +1)

Wend

doc.textField=SourceS 'Places the new text into a text field

Call doc.save(False,True) 'Saves the document

Subject: *But then you modify every single document in every mail db, destroying signatures, etc.