LOTUSSCRIPT/COM/OLE CLASSES


Examples: Position property
This agent writes the content of the Body item of the selected document to a stream, then positions the stream to the beginning (0) before reading from it.

Sub Initialize
 Dim session As NotesSession
 Dim db As NotesDatabase
 Dim dc As NotesDocumentCollection
 Dim doc As NotesDocument
 Dim stream As NotesStream
 Set session = New NotesSession
 Set db = session.CurrentDatabase
 Set dc = db.UnprocessedDocuments
 Set doc = dc.GetFirstDocument
 REM Create stream
 Set stream = session.CreateStream
 REM Write text of Body item to stream
 Call stream.WriteText(doc.GetItemValue("Body")(0))
 REM Reset position to beginning of stream
 stream.Position = 0
 REM Read text from stream
 Messagebox stream.ReadText(),, "Text read from stream"
End Sub

See Also