Examples: GotoFirstDocument and GotoNextDocument methods

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

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 GotoFirstNextDocument_Click()
lastPosition = ""
Call n.GotoFirstDocument
Set e = n.GetCurrent
While e.GetPosition(".") <> lastPosition
  MsgBox e.Document.GetItemValue("Subject")(0), , "Document"
  lastPosition = e.GetPosition(".")
  Call n.GotoNextDocument(e)
  Set e = n.GetCurrent
End Sub
Private Sub InitializeNav_Click()
Set s = New NotesSession
Set db = s.GetDatabase("", "Web test")
Set v = db.GetView("By Category")
v.AutoUpdate = False
Set n = v.CreateViewNav
End Sub