Project::WorksheetPages
WorksheetPages
ClassName
Project
AccessType
public
Description
Collection of all the worksheet pages in the project.
Get a WorksheetPage object by index.
Get a WorksheetPage object by name.
Syntax
Collection<WorksheetPage> WorksheetPages
WorksheetPage WorksheetPages(int index)
WorksheetPage WorksheetPages(LPCSTR lpcszName)
Parameters
- index
- [input]The 0-offset index of the WorksheetPage object in the open project.
- lpcszName
- [input]Name of the worksheet page in Origin.
Return
Returns a valid WorksheetPage object for the index'th WorksheetPage in the project or an invalid WorksheetPage object.
Returns a valid WorksheetPage object having the short name lpcszName or an invalid WorksheetPage object.
Examples
EX1
// This example assumes several existing Worksheet windows
int Project_WorksheetPages_ex1()
{
// Loop over all the worksheet pages in the project and display their names
foreach(WorksheetPage wp in Project.WorksheetPages)
{
out_str(wp.GetName());
}
return 0;
}
EX2
// This example assumes at least one existing worksheet window in Origin
int Project_WorksheetPages_ex2()
{
WorksheetPage wp = Project.WorksheetPages(0); // Get the first worksheet page
if( wp.IsValid() )
out_str(wp.GetName()); // Display the name of the first created worksheet page
return 0;
}
EX3
// This example assumes at least one existing workbook window in Origin
int Project_WorksheetPages_ex3(string strName = "Book1")
{
WorksheetPage wp = Project.WorksheetPages(strName); // Get the WorksheetPage for the worksheet window in Origin having the short name strName
if( wp.IsValid() ) // If valid...
out_str(wp.GetName()); // Use the WorksheetPage object to display the name of the window
return 0;
}
header to Include
origin.h
See Also
Project::Pages, Project::Notes, Project::MatrixPages, Project::GraphPages, Project::LayoutPages, Project::LooseDatasetNames, Project::DatasetNames
Reference
|