CollectionEmbeddedPages::Item

Description

It returns the n'th Page of the collection.


It returns page which has the given name.

Syntax

PageBase Item( int nIndex )

PageBase Item( LPCSTR lpcszName )

Parameters

nIndex
[input] 0-offset index of the requested page in the collection.

lpcszName
[input] the name of the desired page.

Return

the page corresponding to the supplied index.if nindex is invalid, page will be NULL


returns page with the given name. if lpcszName is invalid, page will be NULL

Examples

EX1

void CollectionEmbeddedPages_Item_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if(!wks)
        return;
    
    CollectionEmbeddedPages embeddedPages(wks);
    int nCount = embeddedPages.Count();
    
    int nIndex = nCount - 1;
    Page pg = embeddedPages.Item(nIndex);
    if(!pg)
        printf("Failed to get page");
}


EX2

void CollectionEmbeddedPages_Item_Ex2(string strPageName)
{
    Worksheet wks = Project.ActiveLayer();
    if(!wks)
        return;
    
    CollectionEmbeddedPages embeddedPages(wks);
    int nCount = embeddedPages.Count();
    
    Page pg = embeddedPages.Item(strPageName);
    if(!pg)
        printf("Failed to get %s", strPageName);
    else
        printf("Got embedded page %s", strPageName);
}

Remark

See Also

header to Include

origin.h