2.2.4.34.24 PageBase::SaveToFile

Description

Saves the page to a file.

Syntax

BOOL SaveToFile( LPCSTR lpcszPathName )

Parameters

lpcszPathName
[input]Full pathname to the file location. The extension must be appropriate for type:
WorksheetPage: .OGW
WorksheetPage if Excel: .XLS
GraphPage: .OGG
MatrixPage: .OGM
Note extension not important

Return

Returns TRUE on success and FALSE on failure.

Examples

EX1

int PageBase_SaveToFile_ex1()
{
    // Make sure at least one graph page exists.
    GraphPage pg = Project.GraphPages(0);
    if( !pg )
    {
        out_str("Invalid page!\n");
        return 0;
    }
    // For this to succeed the folder c:\ must exist
    BOOL bOK = pg.SaveToFile("c:\\Origin Graph.ogg");
    out_int("OK = ", bOK);
    return 0;
}

Remark

Saves the page to a file (corresponds to the Save Window As menu item in Origin). Excel books are

saved as native Excel workbook files. Note windows are saved as text files.

See Also

Header to Include

origin.h