例: セッションのプロパティにアクセスする

  1. 次のエージェントは session プロパティを表示します。
    Sub Initialize
      Dim session As New NotesSession
      Dim agent As NotesAgent
      Dim db As NotesDatabase
      Dim international As NotesInternational
      Set agent = session.CurrentAgent
      Messagebox "Name of agent = " & agent.Name
      Set db = session.CurrentDatabase
      Messagebox "Title of database = " & db.Title
      Messagebox "Effective user name = " _
      & session.EffectiveUserName
      Messagebox "User name = " & session.UserName
      Messagebox "Common user name = " _
      & session.CommonUserName
      If session.IsOnServer Then
        Messagebox "Running on server"
      Else
        Messagebox "Running on workstation"
      End If
      Messagebox "Notes version = " _
      & session.NotesVersion
      Messagebox "Notes build version = " _
      & session.NotesBuildVersion
      Messagebox "Platform = " & session.Platform
      Set international = session.International
      Messagebox "Currency symbol = " _
      & international.CurrencySymbol
    End Sub
  2. 次のエージェントはすべてのアドレス帳のタイトルとパスを表示します。
    Sub Initialize
      Dim session As New NotesSession
      Dim db As NotesDatabase
      addressBooks = session.AddressBooks
      Forall addressBook In addressBooks
        Set db = addressBook
        Call db.Open("", "")
        Messagebox db.Title & Chr(10) _
        & "(" & Ucase(db.FilePath) & ")"
      End Forall
    End Sub