LOTUSSCRIPT /COM/OLE のクラス
例:FieldSetText メソッド
1 次のスクリプトは文書が編集モードで開かれるとユーザー名を [Creator] フィールドの値として設定します。たとえば、Brian Flokka が新規文書を作成すると、「Brian Flokka」という文字列が [Creator] フィールドに入れられます。
Sub Postopen(Source As Notesuidocument)
Dim session As New NotesSession
If source.EditMode Then
Call source.FieldSetText _
( "Creator", session.CommonUserName )
End If
End Sub
2 This script gets the value of four number fields: Q1, Q2, Q3, and Q4.取得した値は、Cint() を使って数値に変換されます。スクリプトは 4 つの値を合計して、Cstr() を使って文字列に変換します。変換結果は [Total] フィールドに設定します。
Sub Querysave(Source As Notesuidocument, Continue As Variant)
a% = Cint( source.FieldGetText( "Q1" ) )
b% = Cint( source.FieldGetText( "Q2" ) )
c% = Cint( source.FieldGetText( "Q3" ) )
d% = Cint( source.FieldGetText( "Q4" ) )
Call source.FieldSetText _
( "Total", Cstr( a% + b% + c% + d% ) )
End Sub
関連項目
FieldSetText メソッド
用語集
ヘルプに対するフィードバック
ヘルプの使い方
ヘルプを開く
用語集
ヘルプに対するフィードバック
ヘルプの使い方
ヘルプを開く