| T O P I C R E V I E W |
| billaravi |
Posted - 05/18/2005 : 04:03:46 AM Origin Version (7.0): Operating System:XP PRO
Hi I have a situation where i need to create sunfolders in a project. But before creating i need to verify if a subfolder already exists by that name, so that i wont be creating duplicates of the subfolder. If the subfolder exists i will activate that folder and do operations with in that and if it does not i will create one. how do i go about doing this ?
cheers ravi |
| 1 L A T E S T R E P L I E S (Newest First) |
| greg |
Posted - 05/18/2005 : 09:15:27 AM Recall that the IsValid() method can be used on many objects, so you could use code like the following:
Folder fld = Project.RootFolder; Folder fldsub = fld.Subfolders("MyFolder"); if( fldsub.IsValid() ) printf("Found the subfolder of root named 'MyFolder'\n"); else { printf("Not found. Creating ...'MyFolder'\n"); fldsub = fld.AddSubfolder("MyFolder"); }
|