例: NotesViewColumn class

  1. 次のエージェントは、現在のデータベースの [By Category] ビューのすべての列の位置番号とタイトルを表示します。
    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

    例えば、[By Category] ビューにタイトル付きの列が 2 つ、タイトルなしの列が 3 つある場合は、このスクリプトは次の 5 つの各値を表示するダイアログボックスを 5 回表示します。

    • 1
    • 2
    • 3 Date
    • 4
    • 5 Topic
  2. 次のエージェントは、現在のデータベースの [By Category] ビューの第 3 列を取得します。Columns プロパティが返す配列は要素 0 から始まります。したがって、view.Columns( 2 ) はビューの第 3 列に対応します。
    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. 次のエージェントは、現在のコンピュータの yahoo.nsf データベースの [By Author] ビューでソートされた第 1 列を検索し、この列を column オブジェクトに割り当てます。
    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