XMLNode.PreviousSibling 属性 (Word)XMLNode.PreviousSibling property (Word)

返回一个XMLNode对象,代表与指定元素同级的文档中的前一个元素。Returns an XMLNode object that represents the previous element in the document that is at the same level as the specified element.

语法Syntax

expression.expression. PreviousSibling

_表达式_返回一个XMLNode对象的表达式。expression An expression that returns an 'XMLNode' object.

备注Remarks

如果指定的元素是XMLNodes集合中的第一个元素,此属性返回NothingIf 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

另请参阅See also

XMLNode 对象XMLNode Object