LOTUSSCRIPT/COM/OLE CLASSES


Examples: GetChild method
This script retrieves the child of the first entry in the Java category and places it in a folder.

Sub Initialize
 Dim session As New NotesSession
 Dim db As NotesDatabase
 Dim view As NotesView
 Dim entryA As NotesViewEntry
 Dim entryB As NotesViewEntry
 Dim nav As NotesViewNavigator
 Dim doc As NotesDocument
 Set db = session.CurrentDatabase
 Set view = db.GetView("By Category")
 view.AutoUpdate = False
 If Not view Is Nothing Then
   If view.IsCategorized Then
     Set nav = view.CreateViewNavFromCategory("Java")
     Set entryA = nav.GetFirst
     If Not entryA Is Nothing Then
       If entryA.ChildCount > 0 Then
         Set entryB = nav.GetChild(entryA)
         Set doc = entryB.Document
         If Not doc Is Nothing Then
           Call doc.PutInFolder("My Favorites")
           Messagebox doc.GetItemValue( "Subject" )(0), , _
           "added to My Favorites"
         Else
           Messagebox "no document for this entry"
         End If
       Else
         Messagebox "no child for this entry"
       End If
     Else
       Messagebox "Java", , "nothing in category"
     End If
   Else
     Messagebox "By Category", , "view not categorized"
   End If
 Else
   Messagebox "By Category", , "view not found"
 End If
End Sub

See Also