例: Parent property (NotesViewColumn - LotusScript®)

  1. 次のエージェントは、親ビューの名前を列の表示に含めます。
    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. 次の Visual Basic コードは NotesViewColumn オブジェクトの親ビュー名を表示します。
    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