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. 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

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.