LOTUSSCRIPT/COM/OLE CLASSES


Examples: SetHotSpotTextStyle method
This agent changes the hotspot text and style of 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"
   txt$ = Inputbox$("New hotspot text")
   If txt$ <> "" Then
     rtlink.HotSpotText = txt$
     Set style = session.CreateRichTextStyle
     style.Bold = True
     Call rtlink.SetHotSpotTextStyle(style)
     Call doc.Save(True, False)
   End If
 End If
End Sub

See Also