LOTUSSCRIPT /COM/OLE のクラス
例: Text プロパティ
1. 次のスクリプトは Text プロパティを使って Categories アイテムの内容を取得します。Categories アイテムの内容は文字列リストです。Categories アイテムには 3 つの値「pine tree」、「maple tree」、「spruce tree」が含まれます。Text プロパティは文字列「pine tree;spruce tree;maple tree」を返し、文字列を変数 contents に代入します。
Dim doc As NotesDocument
'...set value of doc...
Dim item As NotesItem
Dim contents As String
Set item = doc.GetFirstItem( "Categories" )
contents = item.Text
2. 次の例では Text プロパティを使って Amount アイテムの内容を取得します。Amount アイテムの種類は数値です。Amount アイテムには 35.2 が含まれます。Text プロパティは文字列「35.2」を返し、文字列を変数 contents に代入します。
Dim doc As NotesDocument
Dim item As NotesItem
Dim contents As String
'...set value of doc...
Set item = doc.GetFirstItem( "Amount" )
contents = item.Text
3. 次の関数は任意の NotesDocument を取得し、Text プロパティを使ってオブジェクトの属性のないテキストのレンダリングを作成します。文書内の名前に「$」を含まない各アイテムに対し、この関数はアイテムの名前と文字列を新規文書の Body アイテムに配置します。新規文書は呼び出し側のルーチンに返されます。plainItem は NotesRichTextItem として宣言されているので、スクリプトは AddNewLine メソッドを使って新規の行を挿入し、各アイテムを区切ることができます。
Function createPlainDoc( doc As NotesDocument ) As NotesDocument
Dim db As NotesDatabase
Dim plainDoc As NotesDocument
Dim plainItem As NotesRichTextItem
Set db = doc.ParentDatabase
Set plainDoc = New NotesDocument( db )
Set plainItem = New NotesRichTextItem _
( plainDoc, "Body" )
itemList = doc.Items
Forall i In itemList
If ( Instr( i.Name, "$" ) = 0 ) Then
Call plainItem.AppendText( i.Name + ":" + i.Text )
Call plainItem.AddNewLine( 1 )
End If
End Forall
Set createPlainDoc = plainDoc
End Function
関連項目
Text プロパティ
用語集
フィードバック
ヘルプ
または
プロダクトユーザビリティ
ヘルプの使い方
すべてのヘルプ項目
用語集