sorry about the format… it's the TAB Notes is using…
was written in 6.0.2; should be okay with 4.x, 5.x, 6.5, too.
Sub Initialize
' Delete all files attachment in the message
' Kspam MailSpam DB
' Feb 2004 by Francois Lafleur
' mod: Mar 2005 by Daniel Stelter (clean deletion)
' ================================
Dim S As New NotesSession<br/>
Dim db As NotesDatabase <br/>
Dim dc As NotesDocumentCollection<br/>
Dim doc As NotesDocument<br/>
Dim RTItem As NotesRichTextItem<br/>
'<br/>
Set db = S.currentDatabase<br/>
Set dc = db.UnprocessedDocuments<br/>
Set doc = dc.GetFirstDocument<br/>
'<br/>
On Error Resume Next 'I don't care about errors here<br/>
'<br/>
Do While Not(doc Is Nothing)<br/>
If doc.HasEmbedded Then<br/>
Set RTItem = doc.Getfirstitem("Body")<br/>
Forall o In RTItem.EmbeddedObjects<br/>
If o.type = 1454 Then 'attachment<br/>
Call o.Remove<br/>
End If<br/>
End Forall<br/>
Call doc.save(True,True)<br/>
End If<br/>
'<br/>
Call S.UpdateProcessedDoc(doc) 'touch doc only once<br/>
'<br/>
Set doc = dc.GetNextDocument(doc)<br/>
Loop<br/>
'<br/>
End Sub
Cheers -Daniel.