Examples: Accessing view or folder columns

  1. This example displays properties of all columns in all views in the current database.

    Sub Initialize
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim views As Variant
      Dim columns As Variant
      Set db = session.CurrentDatabase
      REM view is a NotesView object
      views = db.Views
      Forall view In views
        REM column is a NotesViewColumn object
        columns = view.Columns
        Forall column In columns
          position = column.Position
          title = column.Title
          If title = "" Or title = " " Then 
            title = "<no title>"
          End If
          formu = column.Formula
          Messagebox position & ", " _
          & title & ", " & formu,, view.Name
        End Forall
      End Forall
    End Sub
  2. This example displays properties of the By Category view in a database.
    Sub Initialize
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim view As NotesView
      Set db = session.CurrentDatabase
      Set view = db.GetView("By Category")
      Messagebox "Background color: " & view.BackgroundColor
      Messagebox "Column Count: " & view.ColumnCount
      Messagebox  "Header Lines: " & view.HeaderLines
      Messagebox  "Row Lines: " & view.RowLines
      Messagebox "Spacing: " & view.Spacing
      Messagebox  "Top Level Entries: " & view.TopLevelEntryCount
      If view.IsCategorized Then
        Messagebox "Categorized"
      Else
        Messagebox "Not Categorized"
      End If
      If view.IsConflict Then
        Messagebox "Conflict enabled"
      Else
        Messagebox "Not conflict enabled"
      End If
      If view.IsHierarchical Then
        Messagebox "Hierarchical"
      Else
        Messagebox "Not hierarchical"
      End If
      If view.IsModified Then
        Messagebox "Modified"
      Else
        Messagebox "Not modified"
      End If
    End Sub