LOTUSSCRIPT /COM/OLE のクラス
例:Roles プロパティ
1. 次のスクリプトは、現在のデータベースのすべてのロールの名前を次々に表示します。たとえば、[HR Contact]、[Supervisor]、[Project Leader] のように表示します。
Dim session As New NotesSession
Dim db As NotesDatabase
Dim acl As NotesACL
Set db = session.CurrentDatabase
Set acl = db.ACL
Forall r In acl.Roles
Messagebox( r )
End Forall
2. 次のスクリプトは、ダイアログボックスにロール名を入力するようにユーザーに求めます。名前があるときは、現在の文書の [People] フィールドに、ロールが有効になっている各エントリの名前を表示します。その後ユーザーが入力したロール名に角カッコを付けて、Roles プロパティを使用して、その名前が現在のデータベースにあるかどうかを確認します。名前がないときは、エラーメッセージが表示されます。
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim session As New NotesSession
Dim db As NotesDatabase
Dim acl As NotesACL
Dim entry As NotesACLEntry
Dim roleName As String
Dim foundRole As Variant
Set uidoc = workspace.CurrentDocument
Set db = session.CurrentDatabase
Set acl = db.ACL
roleName = Inputbox$( "Enter the name of the role" )
' add brackets to role
roleName = "[" & roleName & "]"
foundRole = False
' check to see if the role exists in the database
Forall r In acl.Roles
If ( r = roleName ) Then
foundRole = True
Exit Forall
End If
End Forall
If NOT foundRole Then
Messagebox _
( "Sorry, " & roleName & " is not a role" )
' if the role exists, check each acl entry to see if role
' is enabled for entry
' if so, add entry name to the People field
' on the current document,
' followed by a semicolon, the multi-value separator
Else
Set entry = acl.GetFirstEntry
While Not ( entry Is Nothing )
If entry.IsRoleEnabled( roleName ) Then
Call uidoc.FieldAppendText _
( "People", entry.Name & ";" )
End If
Set entry = acl.GetNextEntry( entry )
Wend
End If
' refresh current document so People field displays nicely
Call uidoc.Refresh
関連項目
Roles プロパティ
用語集
フィードバック
ヘルプ
または
プロダクトユーザビリティ
ヘルプの使い方
すべてのヘルプ項目
用語集