次の Visual Basic コード (GotoFirstNext_Click Sub) は、ビューの最初から最後までのすべてのエントリを取得します。
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 GotoEntry_Click()
On Error GoTo errorHandler
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Set e = n.GetCurrent
Set dc = db.Search("SUBJECT = """ + Text1 + """", Nothing, 1)
If dc.Count = 0 Then
MsgBox Text1, , "No Subject with this content"
Exit Sub
Else
Set doc = dc.GetFirstDocument
Call n.GotoEntry(doc)
Set e = n.GetCurrent
If e.Document.GetItemValue("Subject")(0) <> Text1 Then
MsgBox "This document not in this view", , "Not in view"
Else
p = e.GetPosition(".")
MsgBox "Position of entry in view", , p
End If
End If
Exit Sub
errorHandler:
MsgBox "This document not in this view", , "Not in view"
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