LOTUSSCRIPT/COM/OLE CLASSES


Examples: SetTitleStyle method
This agent sets the title style of every section in a rich text 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_SECTION) Then
   Messagebox "Body item does not contain a section,",, "Error"
   Exit Sub
 End If
 Dim rts As NotesRichTextSection
 Dim rtstyle As NotesRichTextStyle
 Set rtstyle = session.CreateRichTextStyle
 rtstyle.FontSize = 12
 Do
   Set rts = rtnav.GetElement
   Call rts.SetTitleStyle(rtstyle)
   Call doc.Save(True, True)
 Loop While rtnav.FindNextElement
 Call doc.Save(True, True)
End Sub

See Also