Retrieve All Columns in a View

This routine iterates through each column in a specified view and displays the column name. When retrieved, the values could be used to produce a spreadsheet or for data manipulation purposes.

How It Works

Using the NotesDatabase and NotesView classes, the routine iterates through a specific view and returns the column names property. Alternatively, you may want to store the column names in a dynamic array or perform some other action with each view column.

Implementation

In the following example, all column names for a given view are processed with the name of each column appended to a string and displayed in a message window. To implement this technique, create an action button. Set the Language Selector to LotusScript and insert the following statements in the Programmer's pane.

Sub Click(Source As Button) '----------------------------------------------------------------- ' Define the objects '----------------------------------------------------------------- Dim s As NotesSession Dim db As NotesDatabase Dim strColTitles As String Dim view As NotesView Set s = New NotesSession Set db = s.CurrentDatabase Set view = db.GetView( "VIEW" ) '----------------------------------------------------------------- ' Display all column titles for specified view '----------------------------------------------------------------- Forall c In view.Columns strColTitles = strColTitles & Chr$(10) & c.Title End Forall Messagebox( strColTitles ) End Sub

Категории