Search code examples
vstoms-project

Root task object is not available in MS Project Tasks collection (VSTO)


I am working with Visual Studio 2010 and targeting MS Project 2013 and for some reason when I iterate through the Tasks collection, the ultimate root does not show up.

For reference, I am using the built in template: "Commercial Construction"

Here is a snippet of my code:

using Microsoft.Office.Interop.MSProject;

Project project;
project = Globals.ThisAddin.Application.ActiveProject;

foreach (Task t in project.Tasks)
{
    // Do something with the task
}

All the tasks EXCEPT the ultimate root shows up. The main problem with this is:

1) How do I create an ultimate root task through VSTO?


Solution

  • Ok, I figured this out. The "ultimate root" is contained in a separate property:

    Globals.ThisAddin.Application.ActiveProject.ProjectSummaryTask