Office.NodeInsertedEventArgs interface

提供有关引发 nodeInserted 事件的已插入节点的信息。

注解

示例

// Event handler for the NodeInserted event added in CustomXmlPart.addHandlerAsync.
function onNodeInserted(eventArgs: Office.NodeInsertedEventArgs) {
    // Logs information about the inserted node.
    console.log("NodeInserted event fired.");
    console.log("  Is undo/redo: " + eventArgs.isUndoRedo);
    eventArgs.newNode.getXmlAsync((result) => {
        if (result.status === Office.AsyncResultStatus.Succeeded) {
            console.log("  Inserted node XML: " + result.value);
        }
    });
}

属性

isUndoRedo

获取节点是否作为用户撤销/还原操作的一部分插入。

newNode

获取刚刚添加到 CustomXMLPart 对象的节点。

请注意,如果刚刚将子树添加到文档中,则此节点可能有子级。

属性详细信息

isUndoRedo

获取节点是否作为用户撤销/还原操作的一部分插入。

isUndoRedo: boolean;

属性值

boolean

newNode

获取刚刚添加到 CustomXMLPart 对象的节点。

请注意,如果刚刚将子树添加到文档中,则此节点可能有子级。

newNode: CustomXmlNode;

属性值