Working with Outline Properties
In Microsoft Project, the outline structure provides a hierarchical view of tasks, helping users organize and navigate large projects. Aspose.Tasks for .NET lets developers programmatically access and manage these outline properties, ensuring consistency when reading or writing Microsoft Project files.
Understanding Outline Properties
Tasks in Microsoft Project have two key outline-related fields:
OutlineNumber Type: String Purpose: Represents the hierarchical number of the task (e.g.,
1.2.3
).OutlineLevel Type: Integer Purpose: Indicates the level of the task in the hierarchy (e.g.,
1
= top-level task,2
= subtask).
These properties are accessible via the Tsk class.
Checking in Microsoft Project
To view outline properties in Microsoft Project:
- Go to the Insert menu and select Column.
- Add the Outline Number and Outline Level fields.
- The project will display hierarchical identifiers (e.g.,
1
,1.1
,1.1.1
) and task levels.
Example: Reading Task Outline Properties
The following C# example demonstrates how to retrieve the OutlineNumber and OutlineLevel of tasks using Aspose.Tasks for .NET:
1Project project = new Project("New Project.mpp");
2
3// Create a ChildTasksCollector instance
4ChildTasksCollector collector = new ChildTasksCollector();
5
6// Collect all the tasks from RootTask using TaskUtils
7TaskUtils.Apply(project.RootTask, collector, 0);
8
9// Parse through all the collected tasks
10foreach (Task task in collector.Tasks)
11{
12 Console.WriteLine(task.Get(Tsk.Name) + " - Outline Level : " + task.Get(Tsk.OutlineLevel));
13 Console.WriteLine(task.Get(Tsk.Name) + " - Outline Number : " + task.Get(Tsk.OutlineNumber));
14}
Key Notes
- OutlineNumber provides a human-readable hierarchy (e.g.,
2.3.1
). - OutlineLevel is numeric, useful for calculations and filtering.
- Outline properties help maintain project structure and are especially important in large projects with multiple subtasks.
FAQ
Q: Can I set outline properties when creating tasks with Aspose.Tasks?
- Yes. You can assign
OutlineNumber
andOutlineLevel
values programmatically.
Q: Do outline properties affect scheduling?
- No. They are structural only and do not impact task duration, dependencies, or critical path.
Q: Are outline properties supported in both MPP and XML formats?
- Yes. Aspose.Tasks ensures consistency across Microsoft Project formats.