Identify Cross Project Tasks

How to Identify Cross Project Tasks

If you have linked a task from one project to a task from the other project, the IDs and UIDs of the task is different in the original and external projects as you can see in the following image:

identifying external tasks in Microsoft Project

The ExternalId property exposed by the Task class is used to find an external task’s original ID. The Id property returns the ID of the external task in the external project whereas the ExternalId property returns the ID of the external task in the original project.

The code below finds the original and external ID of a task.

1Project project = new Project("New Project.mpp");
2Task task = project.RootTask.Children.GetByUid(1);
3
4// Show ID of the task in the external project
5Console.WriteLine(task.Get(Tsk.Id).ToString());
6
7// Show ID of the task in the original project
8Console.WriteLine(task.Get(Tsk.ExternalId).ToString());
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.