How To Detach Attached Documents From A Rich Text Field (Rtitem) Via Lotusscript
a document's Rich Text Field?
The sample script below illustrates one way to accomplish this.
Note: In order for this script to execute as intended, the fields and
documents must have the names used below.
Dim Doc as NotesDocument
Dim RTItem as variant
' ... Set all the relations ...
' ... Retrieve the field which contains the attachment
Set RTItem =
Doc.GetFirstItem("RichTextField")
' ... Test if object exists in the richtextfield
If Isarray( RTItem.EmbeddedObjects) Then
' ... Scan all the objects on the richtextfield
Forall EmbedObject In RTItem.EmbeddedObjects
' ... If they are attachment then detach them
If ( EmbedObject.Type = EMBED_ATTACHMENT ) Then
Call EmbedObject.ExtractFile( "c:\" &
EmbedObject.source
)
End If
End Forall
End If