Manage Learn to apply best practices and optimize your operations.

How To Detach Attached Documents From A Rich Text Field (Rtitem) Via Lotusscript

Using LotusScript, how can you extract to a directory all the files attached to
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 =
' ... 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:\" &
End If
End Forall
End If

Dig Deeper on Domino Resources - Part 4



  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury