NextSibling Property

Microsoft Word Visual Basic

NextSibling Property

Returns an XMLNode object that represents the next element in the document that is at the same level as the specified element.

expression.NextSibling

expression    Required. An expression that returns an XMLNode object.

Remarks

If the specified element is the last element in the XMLNodes collection, this property returns Nothing.

Example

The following example returns the next sibling element to the second element in the active document.

    Dim objNode As XMLNode

Set objNode = ActiveDocument.XMLNodes(2).NextSibling