MoveChild method

The MoveChild method moves a child of a runtime DCO object to a different index location. You can use this method to reorganize or correct batches, documents, pages, or fields.

Description

For example, MoveChild(0,2) moves the object at position 0 to position 2. When you use this method, MoveChild reindexes the other child objects, as needed.
Table 1. Example implementation of MoveChild method
Index Value   Index Value
0 One MoveChild(0, 2) 0 Two
1 Two 1 Three
2 Three   2 One
Before   After

Syntax

VBScript
oDCO.MoveChild(nOldIndex as Long,nNewIndex as Long) as Boolean
C#
bool MoveChild(int nOldIndex, int nNewIndex)

Arguments

nOldIndex
Index value of the current position, of the child object, where 0 is the first child
nNewIndex
Index value of the new position of the child object

Returns

True if successful; False otherwise

Applies to

All objects

C# Example

This example moves the first field on page TM000001 to the third position.
m_oDCO.FindChild("TM000001").MoveChild(0, 2);