LOTUSSCRIPT: (Populates the text into a specified text field on the same document. It will overlook any attachments or images placed in the RichText field without producing an error.)
Sub Initialize
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim collect As NotesDocumentCollection
Set collect = db.UnprocessedDocuments
If collect.count = 0 Then
Msgbox " No Document(s) selected!", 0 + 16
Exit Sub
End If
Dim rtitem As Variant
Dim plainText As String
Dim TargetItem As NotesItem
Dim Doc As NotesDocument
Set Doc = collect.GetFirstDocument
Dim counter As Long
Do
Set rtitem = doc.GetFirstItem( "Body" )
If Not rtitem Is Nothing Then
If ( rtitem.Type = RICHTEXT ) Then
plainText = rtitem.GetFormattedText( False, 0 )
End If
Set TargetItem = doc.ReplaceItemValue( "Comments", plainText )
Call doc.Save(True, True)
End If
Counter = Counter + 1
Print Counter & " of " & collect.count & " have been processed."
Set doc = collect.GetNextDocument(doc)
Loop Until doc Is Nothing
Call workspace.viewrefresh
Print "Process has completed"
End Sub