CustomXMLPart 事件 (Office)CustomXMLPart.NodeAfterReplace event (Office)

恰好在CustomXMLPart对象中的节点被替换之后发生。Occurs just after a node is replaced in a CustomXMLPart object.

语法Syntax

表达式NodeAfterReplace(OldNodenodeinsertedeventargs.newnodeInUndoRedo)expression.NodeAfterReplace(OldNode, NewNode, InUndoRedo)

_表达式_一个返回**CustomXMLPart** 对象的表达式。expression An expression that returns a CustomXMLPart object.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
OldNodeOldNode 必需Required CustomXMLNodeCustomXMLNode 与刚刚从CustomXMLPart对象中删除的节点相对应。Corresponds to the node that was just removed from the CustomXMLPart object. 请注意, 如果仅将子树添加到文档中, 则此节点可能具有子级。Note that this node may have children if a subtree was just added to the document. 此外, 此节点将是中的 "断开连接" 节点, 可以从节点向下查询, 但不能向上查询, 也不能继续。它似乎是单独存在的。Also, this node will be a "disconnected" node in that you can query down from the node, but cannot go up; it appears to exist alone.
Nodeinsertedeventargs.newnodeNewNode 必需Required CustomXMLNodeCustomXMLNode 对应于刚刚添加到 CustomXMLPart 对象的节点。Corresponds to the node just added to the CustomXMLPart object.
InUndoRedoInUndoRedo 必需Required BooleanBoolean 如果节点作为用户的撤消/恢复操作的一部分添加,则返回 TrueReturns True if the node was added as part of an Undo/Redo action by the user.

示例Example

以下示例将显示一条消息,告知用户替换节点的结果。The following example displays a message telling the user the results of replacing the node.

Sub CustomXMLParts_NodeAfterReplace(oldNode As CustomXMLNode, newNode As CustomXMLNode, boolInUndoRedo As Boolean) 
   MsgBox ("The part's node " & oldNode.BaseName & " was replaced with the node " & newNode.BaseName) 
End Sub

另请参阅See also

支持和反馈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.