Examples: Parent property (NotesName - LotusScript®)

This Visual Basic code displays the parent user name of a NotesName object.

Private Sub NotesName_Click()
Dim session As New NotesSession
Dim nam As NotesName
Call session.Initialize
Set nam = session.CreateName( _
"CN=John B Goode/OU=Sales/OU=East/O=Acme/C=US")
Call Display_Names(nam)
End Sub

Private Sub Display_Names(n As NotesName)
MsgBox n.Common,, "Received name"
MsgBox n.Parent.CommonUserName,, "Current user name"
End Sub