Examples: Locating a view or folder

  1. This example finds a view in the current database.
    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. This example finds the default view in the current database.

    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