LOTUSSCRIPT /COM/OLE のクラス


例:NotesRichTextStyle クラス
次の例は、ユーザーが望むテキストを使用してリッチテキストアイテムを作成します。スタイル属性は、テキストが 14 ポイントの Courier になるように設定します。

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", Inputbox("Subject?"))
 Call doc.AppendItemValue _
 ("Categories", Inputbox("Category?"))
 Dim richStyle As NotesRichTextStyle
 Set richStyle = session.CreateRichTextStyle
 richStyle.NotesFont = FONT_COURIER
 richStyle.FontSize = 14
 Dim richText As New NotesRichTextItem(doc, "Body")
 Call richText.AppendStyle(richStyle)
 newPara = Inputbox _
 ("Paragraph of text for ""Body"" item")
 firstPara = True
 While newPara <> ""
   If firstPara Then
     firstPara = False
   Else
     Call richText.AddNewLine(2)
   End If
   Call richText.AppendText(newPara)
   newPara = Inputbox _
   ("Paragraph of text for ""Body"" item")
 Wend
 Call doc.Save(True, False)
End Sub

関連項目