dev.kanngard.net make sure you visit my new blog at: johankanngard.net

Getting the root node of a NotesDOMNode

by Johan Känngård / [LotusScript] / 2005-05-27 / #72


A simple utility function to use when traversing / parsing a DOM tree.

Public Function getRootNodeOf(node As NotesDOMNode) As NotesDOMNode Set getRootNodeOf = node If node.ParentNode.IsNull Then Exit Function Set getRootNodeOf = getRootNodeOf(node.ParentNode) End Function

Use it like this:

Dim rootNode As NotesDOMNode Set rootNode = getRootNodeOf(nodeThatYouWantTheRootOf)