Selection.XMLNodes Property

Word Developer Reference

Returns an XMLNodes collection that represents the collection of all XML elements within a selection—including those elements that are only partially within the selection.

Syntax

expression.XMLNodes

expression   Required. A variable that represents a Selection object.

Example

The following example returns the first XML node in the active document.

Visual Basic for Applications
  Dim objNode As XMLNode
    
Set objNode = ActiveDocument.XMLNodes.Item(1)

See Also