Have you looked at the GetFirstDocument method of the NotesView class?
—ADDED FROM DISCUSSION—-
AGENT CODE – In the Initialize event – not Globals – this is Lotuscript
Dim session as New NotesSession
Dim db as NotesDatabase
Dim view as NotesView
Dim doc as NotesDocument
‘initialize DB object
Set db = session.currentdatabase
‘initialize view document, replace YOURVIEW with the view name or alias
Set view = db.getview( “YOURVIEW” )
Set doc = view.getfirstdocument()
……do processes against the doc object – it is the first document in the view…..