Examples: GotoPrevCategory method

This Visual Basic code (GotoPrevCategory_Click Sub) gets all the category entries in a view from last to first.

Dim s As New NotesSession
Dim db As NotesDatabase
Dim v As NotesView
Dim n As NotesViewNavigator
Dim e As NotesViewEntry
Dim lastPosition As String
Private Sub GotoPrevCategory_Click()
InitializeNav_Click
Call n.GotoLast
Set e = n.GetCurrent
lastPosition = e.GetPosition(".")
Call n.GotoPrevCategory(e)
Set e = n.GetCurrent
While e.GetPosition(".") <> lastPosition
  If e.ColumnValues(0) = "" Then
    MsgBox "Uncategorized", , "Category"
  Else
    MsgBox e.ColumnValues(0), , "Category"
  End If
  lastPosition = e.GetPosition(".")
  Call n.GotoPrevCategory(e)
  Set e = n.GetCurrent
Wend
End Sub
Private Sub InitializeNav_Click()
Set s = New NotesSession
s.Initialize
Set db = s.GetDatabase("", "Web test")
Set v = db.GetView("By Category")
v.AutoUpdate = False
Set n = v.CreateViewNav
End Sub