Predecessor and Successor Tasks

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:

  1. From the View menu, select More Views and then Task Entry Form.
  2. Double-click the desired task.
  3. Select the Predecessor tab.

managing predecessor and successor of the task

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}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.