Examples: NamedElement property

This code loops through the entries in an outline and displays the name of the element (or alias, if supplied) of any entries that link to a named element, one at a time. For example, the following code displays "Named element for first is Home" if one entry in the outline, entitled first, is a Page resource linking to the page element named Home.

Sub Initialize
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Dim outline As NotesOutline
  Dim oe As NotesOutlineEntry
  Dim element As String
  Set db = session.CurrentDatabase
  Set outline = db.GetOutline("Site map")
  Set oe = outline.GetFirst
  While Not (oe Is Nothing)
    If oe.Type = OUTLINE_TYPE_NAMEDELEMENT Then
      element = oe.NamedElement
      Messagebox "Named element for " & oe.Label _
      & " is " & element,, "Entry type"
    End If
    Set oe = outline.GetNext(oe)
  Wend
End Sub