Examples: Parent property (NotesViewColumn - LotusScript®)

  1. This agent includes the name of the parent view as part of a display regarding a column.
    Sub Initialize
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Set db = session.CurrentDatabase
      Forall view In db.Views
        Forall vc In view.Columns
          Call TestForSubject(vc)
        End Forall
      End Forall
    End Sub
    Sub TestForSubject(vc As NotesViewColumn)
      If vc.IsField Then
        If vc.ItemName = "Subject" Then
          Messagebox "Subject is column " & vc.Position,, _
          vc.Parent.Name
        End If
      End If
    End Sub
  2. This Visual Basic code displays the name of the parent view of a NotesViewColumn object.
    Private Sub ViewColumnParent_Click()
    Dim s As New NotesSession
    s.Initialize
    Dim dir As NotesDbDirectory
    Dim db As NotesDatabase
    Dim v As NotesView
    Dim vc As NotesViewColumn
    Set dir = s.GetDbDirectory("")
    Set db = dir.OpenDatabase("Web test")
    Set v = db.GetView("Main View")
    Set vc = v.GetColumn(1)
    MsgBox vc.Parent.Name, , "Name of parent view"
    End Sub