例: ビューやフォルダを検索する

  1. 次の例では、現在のデータベースのビューを検索します。
    Sub Initialize
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim view As NotesView
      Set db = session.CurrentDatabase
      Set view = db.GetView _
      (Inputbox("Exact name of view?"))
      Messagebox "View name: " & view.Name & Chr(10) _
      & "Last modified: " & view.LastModified & Chr(10) _
      & "Created: " & view.Created & Chr(10) _
      & "Universal ID: " & view.UniversalId
    End Sub
  2. 次の例では、現在のデータベースのデフォルトのビューを検索します。

    Sub Initialize
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim view As NotesView
      Dim views As Variant
      Set db = session.CurrentDatabase
      views = db.Views
      Forall v In views
        If v.IsDefaultView Then
          Set view = v
          Exit Forall
        End If
      End Forall
      If view Is Nothing Then
        Messagebox "",, "No default view"
      Else
        Messagebox view.Name,, "Default view"
      End If
    End Sub