Item
It returns the nIndex'th item of the collection.
It returns the item with the name lpcszName in the collection.
_TemplType Item( int nIndex )
_TemplType Item( LPCSTR lpcszName )
the item corresponding to the supplied index.
the item corresponding to the supplied name.
EX1
void run_Collection_Item_ex1() { // Default constructor creates an unattached Collection object: Collection<PageBase> pgColl; // Attach to the collection of all the pages in the project: pgColl = Project.Pages; // Get the first page in the collection: PageBase pg = pgColl.Item(0); // Display the name of the page: out_str(pg.GetName()); }
EX2
// For this example to run, make sure that the project contains // a worksheet window. void run_Collection_Item_ex2() { // Default constructor creates an unattached Collection object: Collection<PageBase> pgColl; // Attach to the collection of all the pages in the project: pgColl = Project.Pages; WorksheetPage wksP = Project.WorksheetPages(0); if(wksP) { // Get the worksheet page in the collection: PageBase pg = pgColl.Item(wksP.GetName()); // Display the name of the page: out_str(pg.GetName()); } }
origin.h