Free Support Forum - aspose.com

How to get outlinelevel's string value of particulat task?

hi,

I am reading mpp file by using Asponse.Project.dll.
mpp file template contains the following form:

Project Name ---- outlinelevel 1
Module 1 ---- outlinelevel 2
Task 1 — outlinelevel 3
Task 2
Module 2
Task 3
Task 4

for the Task 1, how can i get Module 1 which is outlinelevel 2 value.

Tasks allTasks = mppFile.AllTasks;
System.Collections.IEnumerator iter = allTasks.GetEnumerator();
Task task;
string taskName, outlineNumber;
while( iter.MoveNext() == true)
{
task = (Task)iter.Current;
taskName = task.Name.ToString();
// here for the current task Name i need module name
int outlineNo = task.OutlineLevel;
outlineNumber = task.OutlineNumber.ToString();
}

Thanks & Regards,
Siva Sankar Reddy.

Dear Siva,



I didn’t really understand your question.



task.Name property contains “Module 1” string.

You can check it if you need to find some special task by name.

Also you don’t need to call .ToString() function.