Diese Funktion gibt dir das darauffolgende Dokument zurück wenn Du Kategorie markiert hast. Hoffe hilft und ist sicher noch optimierungsfähig. Aber jetzt erst mal Feierabend und Bierchen trinken.

Function NextDocInUIView(db As NotesDatabase,UIView As NotesUIView) As NotesDocument
Dim vwnav As NotesViewNavigator
Dim vwEntry As NotesViewEntry
Dim Found As Boolean
Found=False
Set vwnav=UIView.View.CreateViewNav
Set NextDocInUIView=db.GetDocumentByID(UIView.CaretNoteID)
If NextDocInUIView Is Nothing Then
Set vwEntry=vwnav.GetFirst
Do Until vwEntry Is Nothing
If vwEntry.IsCategory Then
If vwEntry.ColumnValues(vwEntry.IndentLevel) =uiview.CaretCategory Then
Found=True
End If
Else
If Found Then
Set NextDocInUIView=db.GetDocumentByID(vwEntry.NoteID)
Exit Do
End If
End If
Set vwEntry=vwnav.GetNext(vwEntry)
Loop
End If
End Function