例: FontSize property

次の例は、リッチテキストアイテムを作成して、テキストの一部が 12 ポイントと 16 ポイントになるようにスタイルを設定します。

Sub Initialize
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Set db = session.CurrentDatabase
  Dim doc As New NotesDocument(db)
  Call doc.AppendItemValue("From", session.UserName)
  Call doc.AppendItemValue("Subject",  _
  "Meeting time changed")
  Dim richStyle As NotesRichTextStyle
  Set richStyle = session.CreateRichTextStyle
  Dim richText As New NotesRichTextItem(doc, "Body")
  richStyle.FontSize = 12
  Call richText.AppendStyle(richStyle)
  Call richText.AppendText("The meeting is at ")
  richStyle.FontSize = 16
  Call richText.AppendStyle(richStyle)
  Call richText.AppendText("3:00")
  richStyle.FontSize = 12
  Call richText.AppendStyle(richStyle)
  Call richText.AppendText(" not 2:00")
  Call doc.Save(True, False)
End Sub