Domino Code Fragment

Code Name*
Retrieving the Names of all the Columns in a View using NotesView property, Columns
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.145.151.141
Description*
The example below will retrieve each column in the Intermediate view. The column title will be displayed if it exists, otherwise the user will be notified on the lack of a column title.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Through the NotesView property, Columns, all the columns in a view are made accessible. Using a ForAll statement, the columns in a view can be traversed, and, using the Title property, the titles of the columns can be retrieved.



Click here to view the example.

Dim session As New NotesSession 'Declare session as a new Notes session
Dim db As NotesDatabase
'Declare db as a Notes Database
Dim view As NotesView
'Declare view as a Notes View
Set db = session.CurrentDatabase
'Set db to the current Notes database (open)
Set view = db.GetView("Intermediate")
'Set view to a view called "Intermediate"
Forall x In view.Columns
'Loop through all the columns in the Intermediate view
If x.Title = "" Then
'If the title is blank, display a message, otherwise display the title
Messagebox "This column has no title."
'Display a "no column title" message
Else
Messagebox x.Title
'Else display the Title
End If
End Forall
'Loop