PreviousSibling Property

Microsoft Word Visual Basic

PreviousSibling Property

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

expression.PreviousSibling

expression    Required. An expression that returns an XMLNode object.

Remarks

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

Example

The following example returns the previous sibling element to the third element in the active document.

    Dim objNode As XMLNode

Set objNode = ActiveDocument.XMLNodes(3).PreviousSibling