The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 finding different type of origin objects
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

misrapr

India
Posts

Posted - 01/05/2008 :  05:03:47 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 8 pro
Operating System: win xp pro

How to find or list the names of all the objects of a particular kind present in active folder. For example let us say find the names of all the worksheets in the active folder?

cpyang

USA
1406 Posts

Posted - 01/05/2008 :  5:23:13 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The following code shows how to loop active folder to get down to each column in sheets:

 
void list_all()
{
Folder fld = Application.ActiveFolder();
foreach(PageBase pb in fld.Pages)
{
WorksheetPage wp = pb;
if(!wp)
continue;// not wkbook

printf("Book:%s - %s\n", wp.GetName(), wp.GetLongName());
int nn = 1;
foreach(Layer ly in wp.Layers)
{
Worksheet wks = ly;
printf(" %d:%s\n", nn++,wks.GetName());
int kk = 1;
foreach(Column cc in wks.Columns)
{
printf(" %d:Column(%s)\n", kk++, cc.GetName());
}
}
}
}






CP


Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000