LOTUSSCRIPT/COM/OLE CLASSES


Examples: SetAlternateColor method
This agent sets the alternate color for the first or only table in an item.

Sub Initialize
 Dim session As New NotesSession
 Dim db As NotesDatabase
 Set db = session.CurrentDatabase
 Dim dc As NotesDocumentCollection
 Set dc = db.UnprocessedDocuments
 Dim doc As NotesDocument
 Set doc = dc.GetFirstDocument
 Dim rti As NotesRichTextItem
 Set rti = doc.GetFirstItem("Body")
 Dim rtnav As NotesRichTextNavigator
 Set rtnav = rti.CreateNavigator
 If Not rtnav.FindFirstElement(RTELEM_TYPE_TABLE) Then
   Messagebox "Body item does not contain a table,",, "Error"
   Exit Sub
 End If
 Dim rtt As NotesRichTextTable
 Set rtt = rtnav.GetElement
 rtt.Style = TABLESTYLE_TOP
 Dim colorObject As NotesColorObject
 Set colorObject = session.CreateColorObject
 colorObject.NotesColor = COLOR_YELLOW
 Call rtt.SetAlternateColor(colorObject)
 Call doc.Save(True, True)
End Sub

See Also