Examples: NotesViewColumn class

  1. This agent displays the position number and title of every column in the By Category view of 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( "By Category" )
      Forall c In view.Columns
        Messagebox( c.Position & " " & c.Title )
      End Forall
    End Sub

    For example, if the By Category view has five columns, two of which have titles and three of which are untitled, the script displays five dialog boxes with the following values:

    • 1
    • 2
    • 3 Date
    • 4
    • 5 Topic
  2. This agent gets the third column in the By Category view of the current database. The array returned by the Columns property starts at element 0, so view.Columns( 2 ) corresponds to the third column in the view.
    Sub Initialize
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim view As NotesView
      Dim column As NotesViewColumn
      Set db = session.CurrentDatabase
      Set view = db.GetView( "By Category" )
      Set column = view.Columns( 2 )
    End Sub
  3. This agent finds the first sorted column in the By Author view of the YAHOO.NSF database on the current machine and assigns it to the column object.
    Sub Initialize
      Dim db As New NotesDatabase( "", "yahoo.nsf" )
      Dim view As NotesView
      Dim column As NotesViewColumn
      Set view = db.GetView( "By Author" )
      Forall c In view.Columns
        If c.IsSorted Then
          Set column = c
          Exit Forall
        End If
      End Forall
    End Sub