An Office service that supports add-ins to interact with objects in Office client applications.
Hello Abdelrahman Alnashar
After reviewing the API surface and the available documentation, I believe you have already reached the correct conclusion on this matter.
At the moment, there is no pure Office JavaScript solution that allows inserting a task at a specific position or directly under a given parent task in Microsoft Project Desktop.
Microsoft’s own documentation explicitly acknowledges this limitation. In Task pane add-ins for Project it states:
This is reinforced in the GitHub thread you referenced: office-js issue #4614, where a Microsoft contributor also said that: "Project can use the Common APIs, but does not have application-specific APIs in Office.js"
Even setTaskFieldAsync on OutlineLevel/OutlineNumber only changes the visual indent—it does not establish true parent-child relationships, because Project determines hierarchy primarily by the physical row order in the task list.
Taken together, this confirms that the lack of APIs such as task insertion at a specific index, task movement, or explicit parent–child assignment is a platform limitation, not a misuse of Office JS.
Given this, the most viable alternatives are:
- Using COM/VBA or VSTO for Project Desktop, which gives you full control over task insertion, hierarchy, and ordering.
- Considering Project for the Web / Microsoft Graph / Dataverse APIs (Project Online is retiring in September 2026), which offer more flexible task management—if your product architecture allows migration.
Unfortunately, within the constraints of pure Office JS for Project Desktop .mpp files, this scenario is not currently achievable.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.