例: HotSpotTextStyle property (NotesRichTextDocLink - LotusScript®)

次のエージェントは、Body アイテムで最初の文書リンクで使用されているホットスポットテキストの太字属性を切り替えます。

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