Examples: CollapseAllSections method
This script checks to see if the current user has the role Lurker in the current database. If so, it collapses all the sections on the document after the user opens that document.
Sub Postopen(Source As Notesuidocument)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim acl As NotesACL
Dim entry As NotesACLEntry
Set db = session.CurrentDatabase
Set acl = db.ACL
Set entry = acl.GetEntry( session.CommonUserName )
If ( entry.IsRoleEnabled( "Lurker" ) ) Then
Call source.CollapseAllSections
End If
End Sub