insertBefore method

insertBefore(newChild, refChild)

Inserts the specified node immediately before the specified reference node.

insertBefore(newChild: Aspose.Words.Node, refChild: Aspose.Words.Node)
ParameterTypeDescription
newChildNodeThe Node to insert.
refChildNodeThe Node that is the reference node. The newChild is placed before this node.

Remarks

If refChild isnull, inserts newChild at the end of the list of child nodes.

If the newChild is already in the tree, it is first removed.

If the node being inserted was created from another document, you should use DocumentBase.importNode() to import the node to the current document. The imported node can then be inserted into the current document.

Returns

The inserted node.

See Also