Domino Code Fragment

Code Name*
Determining if a Notes View is a View or a Folder using the NotesView property, IsFolder.
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.223.172.252
Description*
Determine if the object you are dealing with is an actual view, or a folder. To do this, use the NotesView property, IsFolder . IsFolder returns a value of 1, (True) if the object represents a folder, or 0, (False) if the object represents an actual view.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
The NotesView class includes both views and folders, meaning both views and folders can be set to an object of type NotesView. At times it will be important to determine if the object you are dealing with is an actual view, or a folder. To do this, use the NotesView property, IsFolder. IsFolder returns a value of 1, (True) if the object represents a folder, or 0, (False) if the object represents an actual view.

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"
If view.IsFolder Then
'Check to see if Intermediate is a folder
Messagebox "Intermediate is a Folder"
'Display a message if the object is a folder
Else
Messagebox "Intermediate is a View"
'Else Display a message if the object is not a folder
End If
Set view = db.GetView("Favorite Examples")
'Set view to a view called "Favorite Examples"
If view.IsFolder Then
'Check to see if Favorite Examples is a folder
Messagebox "Favorite Examples is a folder"
'Display a message if the object is a folder
Else
Messagebox "Favorite Examples is a view"
'Else Display a message if the object is not a folder
End If