SetIndex
Set the index of an object in a collection
BOOL SetIndex( int nIndex, BOOL bUndo = TRUE )
Returns true if the object's index was set, false if not.
EX1
// Create a new workbook, add some sheets and re-arrange the order void OriginObject_SetIndex_Ex1() { WorksheetPage wkPage; wkPage.Create(); // Create an empty sheet in a new workbook wkPage.AddLayer(); // Add a new sheet wkPage.AddLayer(); // Add a new sheet Worksheet wksLayer3 = wkPage.Layers(2); // Attach to the third sheet bool bRet = wksLayer3.SetIndex(0); // Set the third sheet to be first ASSERT(bRet); int nIndex = wksLayer3.GetIndex(); ASSERT(nIndex == 0); // Verify that that the sheet is now first }
OriginObject::GetIndex
origin.h