Navigating through a categorized view

Using LS, how can I navigate through a categorized view, and obtain only the last document in the view category? Using the following code, I access the first document:

view.AutoUpdate = False

count = 0

Set nav = view.CreateViewNav

Set entry = nav.GetFirst

While Not(entry Is Nothing)

count = count + 1

If entry.Childcount > 0 Then

Set doc = nav.Getchild(entry).Document

Print CStr(count) & ": " 	_

& entry.Childcount & " - " 	_

& doc.UserId(0) & " - " 	_

& doc.DateTime(0)

End If

Set entry = nav.GetNextCategory(entry)

Wend

But what I’d really like is to get the last document in each category. Hints? Tips?

Subject: getlastentry

You need to create a notesviewentrycollection based on the category and then use getlastentry

Subject: Perfect

Thanks Dan. Your advice worked like a charm.