|
|
|
|
|
|
|
|
|
|
|
|
|
|
New Release 5.0 classes: NotesViewEntryCollection and NotesViewEntry (continued)
Getting the number of category entries in a view The next example returns the number of category entries in a view.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim vecoll As NotesViewEntryCollection
Dim entry As NotesViewEntry
Dim c As Integer
Set db = session.CurrentDatabase
Set view = db.GetView("viewName")
Set vecoll = view.AllEntries
Set entry = vecoll.GetFirstEntry
c = 0
While Not (entry Is Nothing)
If (entry.IsCategory) Then
c = c + 1
End If
Set entry = vecoll.GetNextEntry(entry)
Wend
MsgBox "The number of categories in the " & view.Name & " is " & Cstr(c)
|
Building an array of documents in a view As we move on in our code examples, this next one shows you how you can build a routine that scrolls through all entries in a view, and assembles an array of all documents found in the view. A message box displays the number of documents found in the view.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim vecoll As NotesViewEntryCollection
Dim entry As NotesViewEntry
Dim docArray()
Set db = session.CurrentDatabase
Set view = db.GetView("Test")
Set vecoll = view.AllEntries
Set entry = vecoll.GetFirstEntry
Redim docArray(0)
While Not (entry Is Nothing)
If (entry.IsDocument) Then
Set docArray(Ubound(docArray)) = entry.Document
Redim Preserve docArray(Ubound(docArray) + 1)
End If
Set entry = vecoll.GetNextEntry(entry)
Wend
Msgbox "Number of documents found in view: " & Cstr(Ubound(docArray) - 1)
|
NotesViewEntry and NotesViewEntryCollection in the Object Browser The NotesViewEntry and NotesViewEntryCollection contain numerous methods and properties, as you can see in Figure A. The Object Browser can be used to view all of them.
FIGURE A
 
You can tinker with all the methods and properties of NotesViewEntry and NotesViewEntryCollection using the spiffy new Release 5.0 Object Browser. Roll over picture for a larger image.
Conclusion Using the NotesViewEntry and NotesViewEntryCollection classes is just like using a NotesDocumentCollection, but the new classes allow you to get more information regarding entries in a view. You can now retrieve category or total entries and determine such characteristics as whether a document has been read or not.
Next month we will continue our travels through Domino 5.0 with more LotusScript goodies.
David Gewirtz is the author of How To Save Jobs and Where Have All The Emails Gone? For more than 20 years, he has analyzed current, historical, and emerging issues relating to technology, competitiveness, and policy. David is the Editor-in-Chief of the ZATZ magazines, is the Cyberterrorism Advisor for the International Association for Counterterrorism and Security Professionals, and is a member of the instructional faculty at the University of California, Berkeley extension. He can be reached at david@zatz.com and you can follow him at http://www.twitter.com/DavidGewirtz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done.
Native to Lotus Domino. The User Experience unseen for Lotus Domino.
Do more with less. Really.
See the possibilities Docova unleashes for Lotus Domino. |
-- Advertisement --
Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.
Register by April 10 to save $200. |
|
|
|
|
|
|
|
|
|
|