Predecessor and Successor Tasks
Contents
[
Hide
Show
]The PredTask and SuccTask properties exposed by the TaskLink class are used to define the predecessor and successor tasks for a TaskLink. Both of these properties read and write a Task object.
Working with Predecessor and Successor Tasks
To manage predecessor tasks in Microsoft Project:
- From the View menu, select More Views and then Task Entry Form.
- Double-click the desired task.
- Select the Predecessor tab.
The code samples below displays predecessor and successor task after traversing the task links in the project and writing the results to a console window.
1Project project = new Project("New Project.mpp");
2
3// Display names of predecessor and successor tasks
4foreach (TaskLink taskLink in project.TaskLinks)
5{
6 Console.WriteLine("Predecessor " + taskLink.PredTask.Get(Tsk.Name));
7 Console.WriteLine("Predecessor " + taskLink.SuccTask.Get(Tsk.Name));
8}