例: GetUserPolicySettings method

  1. 次のエージェントは、/Acme 名前空間の Setup ポリシー文書を取得し、アイテムを表示します。
    Sub Initialize
      Dim session As New NotesSession
      Dim doc As NotesDocument
      Dim msg As String
      Set doc = session.GetUserPolicySettings("Central/Acme", _
      "", POLICYSETTINGS_SETUP, "/Acme")
      msg = "LocAllCatalogServer = " & _
      GetName(doc.LocAllCatalogServer(0)) & Chr(13)
      msg = msg & "LocAllDirectoryServer = " & _
      GetName(doc.LocAllDirectoryServer(0)) & Chr(13)
      msg = msg & "LocAllSametimeServer = " & _
      GetName(doc.LocAllSametimeServer(0))
      Messagebox msg,, "Setup policy for /Acme"
    End Sub
    
    Function GetName(n As String) As String
      If n = "" Then
        GetName = "<None>"
      Else
        GetName = n
      End If
    End Function
  2. 次のエージェントは、Kayak Guy/Acme の Setup ポリシー文書を取得し、アイテムを表示します。
    Sub Initialize
      Dim session As New NotesSession
      Dim doc As NotesDocument
      Dim msg As String
      Set doc = session.GetUserPolicySettings("Central/Acme", _
      "Kayak Guy/Acme", POLICYSETTINGS_SETUP)
      msg = "LocAllCatalogServer = " & _
      GetName(doc.LocAllCatalogServer(0)) & Chr(13)
      msg = msg & "LocAllDirectoryServer = " & _
      GetName(doc.LocAllDirectoryServer(0)) & Chr(13)
      msg = msg & "LocAllSametimeServer = " & _
      GetName(doc.LocAllSametimeServer(0))
      Messagebox msg,, "Setup policy for /Acme"
    End Sub
    
    Function GetName(n As String) As String
      If n = "" Then
        GetName = "<None>"
      Else
        GetName = n
      End If
    End Function