例: CopyColumn method

次のエージェントは、ビューの列をすべて削除し、別のビューの 2 つの列をコピーしてビューを再作成します。

Sub Initialize
  Dim s As New NotesSession
  Dim viewAll As NotesView
  Dim viewTopics As NotesView
  Dim col1 As NotesViewColumn
  Dim col2 As NotesViewColumn
  Set viewAll = s.CurrentDatabase.GetView("All Documents")
  Set viewTopics = s.CurrentDatabase.GetView("Topics")
  While viewTopics.ColumnCount > 0
    Call viewTopics.RemoveColumn(viewTopics.ColumnCount)
  Wend
  Set col1 = viewTopics.CopyColumn(viewAll.Columns(4), 1)
  Messagebox col1.Title,, "Column " & col1.Position
  Set col2 = viewTopics.CopyColumn(viewAll.Columns(0), 2)
  Messagebox col2.Title,, "Column " & col2.Position
End Sub