LOTUSSCRIPT/COM/OLE CLASSES


Examples: GotoEntry method
This Visual Basic code (GotoFirstNext_Click Sub) gets all the 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 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")
Set n = v.CreateViewNav
End Sub

See Also