LOTUSSCRIPT /COM/OLE のクラス


例:IsOnServer プロパティ
次の関数はユーザーの名前を取得して、アドレス帳の [ユーザー] ビューで名前を参照し、ユーザーの [勤務先の電話番号] を文字列で返します。スクリプトがサーバーで実行されるとき、この関数はそのサーバーの Domino ディレクトリを使用します。それ以外の場合は、サーバー Recife の Domino ディレクトリを使用します。

Function getOfficePhone( lname As String ) As String
 Dim session As New NotesSession
 Dim db As NotesDatabase
 Dim view As NotesView
 Dim doc As NotesDocument  
 If session.IsOnServer Then
   ' use the Address Book on the same server as the script
   Set db = New NotesDatabase( "", "names.nsf" )
 Else
   ' use the Address Book on server Recife
   Set db = New NotesDatabase( "Recife", "names.nsf" )
 End If
 Set view = db.GetView( "People" )
 Set doc = view.GetDocumentByKey( lname )
 getOfficePhone = doc.OfficePhoneNumber( 0 )
End Function

関連項目