LOTUSSCRIPT /COM/OLE のクラス
例:GetFirstItem メソッド
1. 次のスクリプトは、文書の Subject アイテムについてメッセージを表示します。
Dim doc As NotesDocument
'...set value of doc...
Dim item As NotesItem
Set item = doc.GetFirstItem( "Subject" )
If ( item Is Nothing ) Then
Messagebox( "No Subject item on the document.")
Else
Messagebox( _
"The Subject item on the document has the value:" _
+ item.Text )
End If
2. 次の例は、文書の DateComposed アイテムの値を取得します。アイテムがないとき (おそらく [DateComposed] が表示用の計算フィールドであるため)、スクリプトは Created プロパティを使用します。
Dim doc As NotesDocument
Dim item As NotesItem
Dim dateTime As New NotesDateTime( "" )
'...set value of doc...
Set item = doc.GetFirstItem( "DateComposed" )
' An item called DateComposed doesn't exist on the document
If ( item Is Nothing ) Then
dateTime.LSLocalTime = doc.Created
' an item called DateComposed exists
' on the document
Else
Set dateTime = item.DateTimeValue
End If
3. 次のスクリプトは文書のリッチテキストアイテムを取得して、テキストを追加します。
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
'...set value of doc...
Set rtitem = doc.GetFirstItem( "Body" )
If ( rtitem.Type = RICHTEXT ) Then
Call rtitem.AppendText( "One line of text" )
Call rtitem.AddNewLine( 2 )
Call rtitem.AppendText( "Another line of text" )
Call doc.Save( False, True )
End If
関連項目
GetFirstItem メソッド
用語集
フィードバック
ヘルプ
または
プロダクトユーザビリティ
ヘルプの使い方
すべてのヘルプ項目
用語集