Dim session as new NotesSession
Dim db As NotesDatabase
Set db = session.currentdatabase
Dim view As NotesView
Set view = db.GetView("viewname")
Dim doc As NotesDocument
Dim count As Integer
Set doc = view.GetFirstDocument
count = 0
Do
count = count + 1
Set doc = view.GetNextDocument(doc)
Loop until doc is nothing
Messagebox(count)