LOTUSSCRIPT/COM/OLE CLASSES


Examples: GetUnformattedText method
This agent gets the unformatted text of the Body item in the first (or only) selected document, replacing a period with a period and a space.

Dim session As NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim rti As NotesRichTextItem

Sub Initialize
 Set session = New NotesSession
 Set db = session.CurrentDatabase
 Set dc = db.UnprocessedDocuments
 If dc.Count = 0 Then Exit Sub
 Set doc = dc.GetFirstDocument
 Set rti = doc.GetFirstItem("Body")
 If rti Is Nothing Then Exit Sub
 t1$ = rti.GetUnformattedText()
 t2$ = ""
 While Len(t1$) > 0
   c$ = Left(t1$, 1)
   t2$ = t2$ & c$
   If c$ = "." Then t2$ = t2$ & " "
   t1$ = Right(t1$, Len(t1$) - 1)
 Wend
 Messagebox t2$,, "Text of Body"
End Sub

See Also