LOTUSSCRIPT/COM/OLE CLASSES


Examples: HotSpotTextStyle property
This agent toggles the bold attribute of the hotspot text for the first doclink in the Body item.

Sub Initialize
 Dim session As NotesSession
 Dim db As NotesDatabase
 Dim dc As NotesDocumentCollection
 Dim doc As NotesDocument
 Dim rti As NotesRichTextItem
 Dim rtnav As NotesRichTextNavigator
 Dim rtlink As NotesRichTextDocLink
 Dim style As NotesRichTextStyle
 Set session = New NotesSession
 Set db = session.CurrentDatabase
 Set dc = db.UnprocessedDocuments
 Set doc = dc.GetFirstDocument
 Set rti = doc.GetFirstItem("Body")
 Set rtnav = rti.CreateNavigator
 If Not rtnav.FindFirstElement(RTELEM_TYPE_DOCLINK) Then
   Messagebox "No doclinks in Body item",, "No doclinks"
   Exit Sub
 End If
 Set rtlink = rtnav.GetElement
 If rtlink.HotSpotText = "" Then
   Messagebox "Not a hotspot",, "Hotspot text"
 Else
   Messagebox rtlink.HotSpotText,, "Hotspot text"
   Set style = rtlink.HotSpotTextStyle
   If style.Bold Then
     style.Bold = False
   Else
     style.Bold = True
   End If
   Call rtlink.SetHotSpotTextStyle(style)
   Call doc.Save(True, False)
 End If
End Sub

See Also