2.2.4.33.4 Page::Clone

Description

Clone the current page. The same operation with duplicate page in Origin.

Syntax

Page Clone( DWORD dwCntrl = 0 )

Parameters

dwCntrl
[input] control options. See the CREATE_* flags in oc_const.h

Return

The cloned page object.

Examples

EX1

// Clone worksheet, before calling make sure the worksheet exist
void Page_Clone_ex1()
{
    WorksheetPage wksPage("Book1");
    WorksheetPage wksPage2 = wksPage.Clone();
    if( !wksPage2 )  //Check if the worksheet exist
        printf("Fail to clone");
    else
        printf("The name of clone page is %s\n", wksPage2.GetName());
}

EX2

// Clone Matrix, before calling make sure the matrix book exist
void Page_Clone_ex2()
{
	MatrixPage matPg("MBook1");
    MatrixPage matPg2 = matPg.Clone();
	if( !matPg2 )  //Check if the matrix exist
        printf("Fail to clone");
    else
        printf("The name of clone page is %s\n", matPg2.GetName());
}

EX3

// Clone graph, before calling make sure the graph exist
void Page_Clone_ex3()
{
	GraphPage gp("Graph1");
    GraphPage gp2 = gp.Clone(CREATE_HIDDEN);    //Clone the graph and set it as hidden
    
    if( !gp2 )  //Check if the hidden graph exist
        printf("Fail to clone");
    else
        printf("The name of clone graph page is %s\n", gp2.GetName());
}

Remark

See Also

Header to Include

origin.h